repo
stringlengths
5
106
file_url
stringlengths
78
301
file_path
stringlengths
4
211
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:56:49
2026-01-05 02:23:25
truncated
bool
2 classes
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/nodejs-addons/build.js
examples/nodejs-addons/build.js
global.NO_PUBLIC_PATH = true; const cp = require("child_process"); const path = require("path"); const fs = require("fs"); cp.exec(`node-gyp --target=${process.version} configure build`, (error, stdout, stderr) => { if (stderr) { console.log(stderr); } if (error !== null) { console.log(error); } fs.copyFil...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/nodejs-addons/webpack.config.js
examples/nodejs-addons/webpack.config.js
"use strict"; /** @type {import("webpack").Configuration} */ const config = { // mode: "development" || "production", target: "node", output: { // We strong recommend use `publicPath: 'auto'` or do not set `publicPath` at all to generate relative URLs // publicPath: 'auto' }, module: { rules: [ { tes...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/nodejs-addons/example.js
examples/nodejs-addons/example.js
import { dlopen } from 'node:process'; import { fileURLToPath } from 'node:url'; const file = new URL("./file.node", import.meta.url); const myModule = { exports: {} }; try { dlopen(myModule, fileURLToPath(file)); } catch (err) { console.log(err) // Handling errors } console.log(myModule.exports.hello()); // Outp...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/code-splitting-harmony/build.js
examples/code-splitting-harmony/build.js
require("../build-common");
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/code-splitting-harmony/webpack.config.js
examples/code-splitting-harmony/webpack.config.js
"use strict"; /** @type {import("webpack").Configuration} */ const config = { optimization: { chunkIds: "deterministic" // To keep filename consistent between different modes (for example building only) } }; module.exports = config;
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/code-splitting-harmony/example.js
examples/code-splitting-harmony/example.js
import a from "a"; import("b").then(function(b) { console.log("b loaded", b); }) function loadC(name) { return import("c/" + name); } Promise.all([loadC("1"), loadC("2")]).then(function(arr) { console.log("c/1 and c/2 loaded", arr); });
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/code-splitting-harmony/node_modules/b.js
examples/code-splitting-harmony/node_modules/b.js
// module b
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/code-splitting-harmony/node_modules/a.js
examples/code-splitting-harmony/node_modules/a.js
// module a
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/code-splitting-harmony/node_modules/c/1.js
examples/code-splitting-harmony/node_modules/c/1.js
// module c/1
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/code-splitting-harmony/node_modules/c/2.js
examples/code-splitting-harmony/node_modules/c/2.js
// module c/2
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/scope-hoisting/build.js
examples/scope-hoisting/build.js
require("../build-common");
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/scope-hoisting/lazy.js
examples/scope-hoisting/lazy.js
export * from "c"; import * as d from "d"; export { d };
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/scope-hoisting/webpack.config.js
examples/scope-hoisting/webpack.config.js
"use strict"; /** @type {import("webpack").Configuration} */ const config = { // mode: "development" || "production", optimization: { usedExports: true, concatenateModules: true, chunkIds: "named" // To keep filename consistent between different modes (for example building only) } }; module.exports = config;...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/scope-hoisting/example.js
examples/scope-hoisting/example.js
import { a, x, y } from "a"; import * as b from "b"; import("./lazy").then(function(lazy) { console.log(a, b.a(), x, y, lazy.c, lazy.d.a, lazy.x, lazy.y); });
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/scope-hoisting/node_modules/b.js
examples/scope-hoisting/node_modules/b.js
// module b export function a() { return "b"; };
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/scope-hoisting/node_modules/cjs.js
examples/scope-hoisting/node_modules/cjs.js
// module cjs (commonjs) exports.c = "e";
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/scope-hoisting/node_modules/d.js
examples/scope-hoisting/node_modules/d.js
// module d export var a = "d";
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/scope-hoisting/node_modules/c.js
examples/scope-hoisting/node_modules/c.js
// module c import { c as e } from "cjs"; export var c = String.fromCharCode(e.charCodeAt(0) - 2); export { x, y } from "shared";
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/scope-hoisting/node_modules/shared.js
examples/scope-hoisting/node_modules/shared.js
// shared module export var x = "x"; export * from "shared2";
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/scope-hoisting/node_modules/a.js
examples/scope-hoisting/node_modules/a.js
// module a export var a = "a"; export * from "shared";
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/scope-hoisting/node_modules/shared2.js
examples/scope-hoisting/node_modules/shared2.js
// shared2 module export var y = "y";
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/module-code-splitting/methods.js
examples/module-code-splitting/methods.js
export const resetCounter = async () => { (await import("./counter")).reset(); }; export const print = value => console.log(value);
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/module-code-splitting/counter.js
examples/module-code-splitting/counter.js
export let value = 0; export function increment() { value++; } export function decrement() { value--; } export function reset() { value = 0; }
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/module-code-splitting/build.js
examples/module-code-splitting/build.js
require("../build-common");
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/module-code-splitting/webpack.config.js
examples/module-code-splitting/webpack.config.js
"use strict"; /** @type {import("webpack").Configuration} */ const config = { output: { module: true, library: { type: "module" } }, optimization: { usedExports: true, concatenateModules: true }, target: "browserslist: last 2 chrome versions", experiments: { outputModule: true } }; module.export...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/module-code-splitting/example.js
examples/module-code-splitting/example.js
import { resetCounter, print } from "./methods"; setTimeout(async () => { const counter = await import("./counter"); print(counter.value); counter.increment(); counter.increment(); counter.increment(); print(counter.value); await resetCounter(); print(counter.value); }, 100);
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/worker/fibonacci.js
examples/worker/fibonacci.js
export function fibonacci(n) { return n < 1 ? 0 : n <= 2 ? 1 : fibonacci(n - 1) + fibonacci(n - 2); }
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/worker/chat-worker.js
examples/worker/chat-worker.js
import { history, add } from "./chat-module"; onconnect = function (e) { for (const port of e.ports) { port.onmessage = event => { const msg = event.data; switch (msg.type) { case "message": add(msg.content, msg.from); // fallthrough case "history": port.postMessage({ type: "histor...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/worker/build.js
examples/worker/build.js
global.NO_TARGET_ARGS = true; global.NO_PUBLIC_PATH = true; require("../build-common");
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/worker/fib-worker.js
examples/worker/fib-worker.js
onmessage = async event => { const { fibonacci } = await import("./fibonacci"); const value = JSON.parse(event.data); postMessage(`fib(${value}) = ${fibonacci(value)}`); };
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/worker/webpack.config.js
examples/worker/webpack.config.js
"use strict"; const path = require("path"); /** @type {import("webpack").Configuration} */ const config = { entry: "./example.js", output: { path: path.join(__dirname, "dist"), filename: "[name].js", chunkFilename: "[name].js", publicPath: "/dist/" }, optimization: { concatenateModules: true, usedExpo...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/worker/chat-module.js
examples/worker/chat-module.js
export const history = []; export const add = (content, from) => { if (history.length > 10) history.shift(); history.push(`${from}: ${content}`); };
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/worker/example.js
examples/worker/example.js
document.body.innerHTML = ` <pre id="history"></pre> <form> <input id="message" type="text"> <button id="send">Send Message</button> </form> <p>Computing fibonacci without worker:</p> <input id="fib1" type="number"> <pre id="output1"></pre> <p>Computing fibonacci with worker:</p> <input id="fib2" type="number...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/dll-user/build.js
examples/dll-user/build.js
require("../build-common");
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/dll-user/webpack.config.js
examples/dll-user/webpack.config.js
"use strict"; const path = require("path"); const webpack = require("../../"); /** @type {import("webpack").Configuration} */ const config = { // mode: "development" || "production", plugins: [ new webpack.DllReferencePlugin({ context: path.join(__dirname, "..", "dll"), manifest: require("../dll/dist/alpha-...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/dll-user/example.js
examples/dll-user/example.js
console.log(require("../dll/alpha")); console.log(require("../dll/a")); console.log(require("beta/beta")); console.log(require("beta/b")); console.log(require("beta/c")); console.log(require("module"));
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/code-splitted-require.context/build.js
examples/code-splitted-require.context/build.js
require("../build-common");
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/code-splitted-require.context/webpack.config.js
examples/code-splitted-require.context/webpack.config.js
"use strict"; /** @type {import("webpack").Configuration} */ const config = { optimization: { chunkIds: "named" // To keep filename consistent between different modes (for example building only) } }; module.exports = config;
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/code-splitted-require.context/example.js
examples/code-splitted-require.context/example.js
function getTemplate(templateName, callback) { require.ensure([], function(require) { callback(require("../require.context/templates/"+templateName)()); }); } getTemplate("a", function(a) { console.log(a); }); getTemplate("b", function(b) { console.log(b); });
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/stats-detailed/build.js
examples/stats-detailed/build.js
global.NO_REASONS = true; global.NO_STATS_OPTIONS = true; global.STATS_COLORS = false; require("../build-common");
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/stats-detailed/webpack.config.js
examples/stats-detailed/webpack.config.js
"use strict"; const path = require("path"); /** @type {import("webpack").Configuration} */ const config = { output: { path: path.join(__dirname, "dist"), filename: "output.js" }, stats: "detailed" }; module.exports = config;
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/stats-detailed/example.js
examples/stats-detailed/example.js
console.log("Hello World!");
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/stats-summary/build.js
examples/stats-summary/build.js
global.NO_REASONS = true; global.NO_STATS_OPTIONS = true; global.STATS_COLORS = false; require("../build-common");
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/stats-summary/webpack.config.js
examples/stats-summary/webpack.config.js
"use strict"; const path = require("path"); /** @type {import("webpack").Configuration} */ const config = { output: { path: path.join(__dirname, "dist"), filename: "output.js" }, stats: "summary" }; module.exports = config;
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/stats-summary/example.js
examples/stats-summary/example.js
console.log("Hello World!");
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/harmony-library/build.js
examples/harmony-library/build.js
global.NO_TARGET_ARGS = true; require("../build-common");
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/harmony-library/webpack.config.js
examples/harmony-library/webpack.config.js
"use strict"; const path = require("path"); /** @type {import("webpack").Configuration} */ const config = { // mode: "development" || "production", entry: "./example", output: { path: path.join(__dirname, "dist"), filename: "MyLibrary.umd.js", library: "MyLibrary", libraryTarget: "umd" } }; module.export...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/harmony-library/example.js
examples/harmony-library/example.js
export var value = 0; export function increment() { value++; } export default "MyLibrary";
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/loader/loader.js
examples/loader/loader.js
module.exports = function(content) { return "exports.answer = 42;\n" + content; }
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/loader/build.js
examples/loader/build.js
require("../build-common");
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/loader/webpack.config.js
examples/loader/webpack.config.js
"use strict"; /** @type {import("webpack").Configuration} */ const config = { // mode: "development" || "production", module: { rules: [ { test: /\.css$/, loader: "css-loader" } ] } }; module.exports = config;
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/loader/file.js
examples/loader/file.js
exports.foo = "bar";
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/loader/example.js
examples/loader/example.js
// use our loader console.dir(require("./loader!./file")); // use built-in css loader console.dir(require("./test.css")); // default by extension console.dir(require("!css-loader!./test.css")); // manual
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/hybrid-routing/router.js
examples/hybrid-routing/router.js
var render = require("./render"); // Event when another page should be opened // Maybe hook click on links, hashchange or popstate window.onLinkToPage = function onLinkToPage(name) { // name is "a" or "b" // require the page with a dynamic require // It's important that this require only matches the pages // othe...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/hybrid-routing/build.js
examples/hybrid-routing/build.js
global.NO_TARGET_ARGS = true; require("../build-common");
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/hybrid-routing/aPage.js
examples/hybrid-routing/aPage.js
module.exports = function() { return "This is page A."; };
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/hybrid-routing/bEntry.js
examples/hybrid-routing/bEntry.js
// Just show the page "b" var render = require("./render"); render(require("./bPage"));
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/hybrid-routing/render.js
examples/hybrid-routing/render.js
module.exports = function(page) { console.log(page()); };
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/hybrid-routing/aEntry.js
examples/hybrid-routing/aEntry.js
// Just show the page "a" var render = require("./render"); render(require("./aPage"));
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/hybrid-routing/webpack.config.js
examples/hybrid-routing/webpack.config.js
"use strict"; const path = require("path"); /** @type {import("webpack").Configuration} */ const config = { // mode: "development" || "production", entry: { // The entry points for the pages // They also contains router pageA: ["./aEntry", "./router"], pageB: ["./bEntry", "./router"] }, output: { path: ...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/hybrid-routing/bPage.js
examples/hybrid-routing/bPage.js
module.exports = function() { return "This is page B."; };
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/multi-compiler/build.js
examples/multi-compiler/build.js
global.NO_TARGET_ARGS = true; require("../build-common");
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/multi-compiler/mobile-stuff.js
examples/multi-compiler/mobile-stuff.js
// mobile only stuff
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/multi-compiler/webpack.config.js
examples/multi-compiler/webpack.config.js
"use strict"; const path = require("path"); const webpack = require("../../"); /** @type {import("webpack").Configuration[]} */ const config = [ { name: "mobile", // mode: "development" || "production", entry: "./example", output: { path: path.join(__dirname, "dist"), filename: "mobile.js" }, plugi...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/multi-compiler/example.js
examples/multi-compiler/example.js
if(ENV === "mobile") { require("./mobile-stuff"); } console.log("Running " + ENV + " build");
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/node_modules/module.js
examples/node_modules/module.js
module.exports = "module";
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/top-level-await/db-connection.js
examples/top-level-await/db-connection.js
const connectToDB = async url => { await new Promise(r => setTimeout(r, 1000)); }; // This is a top-level-await await connectToDB("my-sql://example.com"); export const dbCall = async data => { // This is a normal await, because it's in an async function await new Promise(r => setTimeout(r, 100)); return "fake dat...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/top-level-await/UserApi.js
examples/top-level-await/UserApi.js
import { dbCall } from "./db-connection.js"; export const createUser = async name => { command = `CREATE USER ${name}`; // This is a normal await, because it's in an async function await dbCall({ command }); };
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/top-level-await/build.js
examples/top-level-await/build.js
require("../build-common");
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/top-level-await/Actions.js
examples/top-level-await/Actions.js
// import() doesn't care about whether a module is an async module or not const UserApi = import("./UserApi.js"); export const CreateUserAction = async name => { // These are normal awaits, because they are in an async function const { createUser } = await UserApi; await createUser(name); }; // You can place impor...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/top-level-await/webpack.config.js
examples/top-level-await/webpack.config.js
"use strict"; /** @type {import("webpack").Configuration} */ const config = { optimization: { chunkIds: "named" // To keep filename consistent between different modes (for example building only) } }; module.exports = config;
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/top-level-await/example.js
examples/top-level-await/example.js
import { CreateUserAction } from "./Actions.js"; (async ()=> { await CreateUserAction("John"); })();
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/http2-aggressive-splitting/build.js
examples/http2-aggressive-splitting/build.js
global.NO_TARGET_ARGS = true; global.NO_REASONS = true; require("../build-common");
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/http2-aggressive-splitting/webpack.config.js
examples/http2-aggressive-splitting/webpack.config.js
"use strict"; const path = require("path"); const webpack = require("../../"); /** @type {import("webpack").Configuration} */ const config = { // mode: "development" || "production", cache: true, // better performance for the AggressiveSplittingPlugin entry: "./example", output: { path: path.join(__dirname, "di...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/http2-aggressive-splitting/example.js
examples/http2-aggressive-splitting/example.js
require("react"); require(["react-dom"]);
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/harmony-interop/build.js
examples/harmony-interop/build.js
require("../build-common");
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/harmony-interop/reexport-commonjs.js
examples/harmony-interop/reexport-commonjs.js
// reexport a CommonJs module export * from "./fs"; // Note that the default export doesn't reexport via export * // (this is not interop-specific, it applies for every export *) // Note: reexporting a CommonJs module is a special case, // because in this module we have no information about exports
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/harmony-interop/example2.js
examples/harmony-interop/example2.js
// CommonJs module // require a harmony module var module = require("./harmony"); var defaultExport = module.default; var namedExport = module.named;
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/harmony-interop/harmony.js
examples/harmony-interop/harmony.js
// just some exports export default "default"; export var named = "named";
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/harmony-interop/example.js
examples/harmony-interop/example.js
// harmony module // import from CommonJS module import fs from "./fs"; import { readFile } from "./fs"; import * as fs2 from "./fs"; fs.readFile("file"); readFile("file"); fs2.readFile("file"); // import from harmony module import { readFile as readFile2 } from "./reexport-commonjs"; readFile2("file"); // import a ...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/harmony-interop/fs.js
examples/harmony-interop/fs.js
// an example CommonJs module // content is omitted for brevity exports.readFile = function() {}; // using module.exports would be equivalent, // webpack doesn't care which syntax is used // AMD modules are also possible and equivalent to CommonJs modules
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/css/build.js
examples/css/build.js
require("../build-common");
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/css/webpack.config.js
examples/css/webpack.config.js
"use strict"; /** @type {import("webpack").Configuration} */ const config = { output: { uniqueName: "app" }, experiments: { css: true } }; module.exports = config;
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/css/example.js
examples/css/example.js
import "./style.css"; import "./style2.css"; import { main } from "./style.module.css"; import("./lazy-style.css"); document.getElementsByTagName("main")[0].className = main;
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/source-map/build.js
examples/source-map/build.js
global.NO_TARGET_ARGS = true; require("../build-common");
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/source-map/webpack.config.js
examples/source-map/webpack.config.js
"use strict"; const path = require("path"); const devtools = [ "eval", "eval-cheap-source-map", "eval-cheap-module-source-map", "eval-source-map", "cheap-source-map", "cheap-module-source-map", "inline-cheap-source-map", "inline-cheap-module-source-map", "source-map", "inline-source-map", "hidden-source-ma...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/module-worker/fibonacci.js
examples/module-worker/fibonacci.js
export function fibonacci(n) { return n < 1 ? 0 : n <= 2 ? 1 : fibonacci(n - 1) + fibonacci(n - 2); }
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/module-worker/chat-worker.js
examples/module-worker/chat-worker.js
onconnect = function (e) { for (const port of e.ports) { port.onmessage = async event => { const msg = event.data; switch (msg.type) { case "message": const { add } = await import("./chat-module"); add(msg.content, msg.from); // fallthrough case "history": const { history } = await i...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/module-worker/build.js
examples/module-worker/build.js
global.NO_TARGET_ARGS = true; global.NO_PUBLIC_PATH = true; require("../build-common");
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/module-worker/fib-worker.js
examples/module-worker/fib-worker.js
onmessage = async event => { const { fibonacci } = await import("./fibonacci"); const value = JSON.parse(event.data); postMessage(`fib(${value}) = ${fibonacci(value)}`); };
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/module-worker/webpack.config.js
examples/module-worker/webpack.config.js
"use strict"; const path = require("path"); /** @type {import("webpack").Configuration} */ const config = { entry: "./example.js", output: { path: path.join(__dirname, "dist"), filename: "[name].js", chunkFilename: "[name].js", publicPath: "/dist/" }, optimization: { chunkIds: "deterministic" // To keep...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/module-worker/chat-module.js
examples/module-worker/chat-module.js
export const history = []; export const add = (content, from) => { if (history.length > 10) history.shift(); history.push(`${from}: ${content}`); };
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/module-worker/example.js
examples/module-worker/example.js
document.body.innerHTML = ` <pre id="history"></pre> <form> <input id="message" type="text"> <button id="send">Send Message</button> </form> <p>Computing fibonacci without worker:</p> <input id="fib1" type="number"> <pre id="output1"></pre> <p>Computing fibonacci with worker:</p> <input id="fib2" type="number...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/wasm-bindgen-esm/test.filter.js
examples/wasm-bindgen-esm/test.filter.js
"use strict"; const supportsWebAssembly = require("../../test/helpers/supportsWebAssembly"); module.exports = () => supportsWebAssembly();
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/wasm-bindgen-esm/build.js
examples/wasm-bindgen-esm/build.js
require("../build-common");
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/wasm-bindgen-esm/webpack.config.js
examples/wasm-bindgen-esm/webpack.config.js
"use strict"; /** @type {import("webpack").Configuration} */ const config = { // mode: "development || "production", output: { webassemblyModuleFilename: "[hash].wasm", publicPath: "dist/" }, module: { rules: [ { test: /\.wasm$/, type: "webassembly/async" } ] }, optimization: { chunkIds: ...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/wasm-bindgen-esm/example.js
examples/wasm-bindgen-esm/example.js
import { greeting } from "./pkg"; document.write(greeting('Bob'));
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/wasm-bindgen-esm/pkg/hi_wasm.js
examples/wasm-bindgen-esm/pkg/hi_wasm.js
import * as wasm from "./hi_wasm_bg.wasm"; export * from "./hi_wasm_bg.js";
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/wasm-bindgen-esm/pkg/hi_wasm_bg.js
examples/wasm-bindgen-esm/pkg/hi_wasm_bg.js
import * as wasm from './hi_wasm_bg.wasm'; let WASM_VECTOR_LEN = 0; let cachegetUint8Memory0 = null; function getUint8Memory0() { if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) { cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer); } return cachegetU...
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false
webpack/webpack
https://github.com/webpack/webpack/blob/d2a124db548cad6e84dffd93b502a4e74bfe2b6a/examples/common-chunk-grandchildren/pageB.js
examples/common-chunk-grandchildren/pageB.js
module.exports = function() { console.log("Page B"); require.ensure([], ()=>{ const page = require("./pageC"); page(); }); };
javascript
MIT
d2a124db548cad6e84dffd93b502a4e74bfe2b6a
2026-01-04T14:56:49.698101Z
false