text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
it("should be able to load a chunk", async () => {
await expect(
import(/* webpackChunkName: "2" */ "./chunk2")
).resolves.toMatchObject({ default: 2 });
});
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>export default 1;
<|fim_suffix|><|fim_middle|><|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>expo<|fim_suffix|>lt 2;
<|fim_middle|>rt defau<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|><|fim_prefix|>"use strict";
module.exports = {
findBundl<|fim_middle|>e() {
return ["11.js", "22.js", "aa.js", "bbb.js"];
}
};
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|> @typedef {import("../../../../").PathData & { chunk: Chunk }} PathData */
/** @type {import("../../../../").Configuration} */
module.exports = {
mode: "development",
entry: {
a: "./a",
b: {
import: "./b",
/**
* @param {PathData} data data
* @returns {string} filename
*/
filena... | fim | webpack/webpack | javascript |
<|fim_suffix|> source = fs.readFileSync(__filename + ".map", "utf-8");
var map = JSON.parse(source);
expect(map.sources).toContain("dummy:///./test.js");
});
if (Math.random() < 0) require("./test.js");
<|fim_prefix|>it("should <|fim_middle|>include test.js in SourceMap", function() {
var fs = require("fs");
var<|... | fim | webpack/webpack | javascript |
<|fim_prefix|>// empt<|fim_suffix|>
<|fim_middle|>y<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>_dirname: false,
__filename: false
},
devtool: "cheap-source-map"
};
<|fim_prefix|>"use strict";
/**<|fim_middle|> @type {import("../../../../").Configuration} */
module.exports = {
mode: "development",
output: {
devtoolModuleFilenameTemplate(info) {
return `dummy:///${info.resourcePath}`;
}... | fim | webpack/webpack | javascript |
<|fim_prefix|>it("should allow to access __webpack_get_script_filename__ ", done => {
const oldFn = __webpack_get_script_filename__;
__webpack_get_script_filename__ = chunk => {
const filename = oldFn(chunk);
return filename + ".changed";
};
import("./test.js").<|fim_suffix|>}
);
});
<|fim_middle|>then(
() =... | fim | webpack/webpack | javascript |
<|fim_suffix|><|fim_prefix|>// <|fim_middle|>empty
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
/** @type {import("../../../../").Configuration} */
module.exports = {
m<|fim_suffix|>"development"
};
<|fim_middle|>ode: <|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>it("should create a vendor file", function() {
var fs = require("fs");
var path = require("path");
if(!fs.existsSync(path.join(__dirname, "vendor.js")))
throw new <|fim_suffix|>ndor.js file was not created");
});
it("should be able to load the vendor module", function() {
require("test");
});
<|fi... | fim | webpack/webpack | javascript |
<|fim_suffix|>t: "commonjs2"
},
optimization: {
splitChunks: {
cacheGroups: {
vendor: {
test: /node_modules/,
chunks: "initial",
filename: "vendor.js",
enforce: true
}
}
}
}
};
<|fim_prefix|>"use strict";
/** @type {import("../../../../").Configuration} */
module.exports = {
m... | fim | webpack/webpack | javascript |
<|fim_prefix|>it("should compile", func<|fim_suffix|>});
<|fim_middle|>tion(done) {
done();
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
/**
* @this {import("../../../../").Compiler} the compiler
*/
func<|fim_suffix|> compilation.hooks.finishModules.tapAsync(
"TestPlugin",
(_modules, callback) => {
callback();
}
);
});
}
/** @type {import("../../../../").Configuration} */
module.exports = {
plugins: [test... | fim | webpack/webpack | javascript |
<|fim_suffix|>d chunk", async () => {
const c2 = await c1();
const c1_ = await c2.default();
expect(c1_.value).toBe(1);
});
<|fim_prefix|>impo<|fim_middle|>rt c1 from "./c1";
it("should allow to import an conditionally unneede<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>import c2 from "./c2";
it("should allow to import an conditionally unneeded chunk", async () =<|fim_suffix|>const c1 = await c2();
const c2_ = await c1.default();
expect(c2_.value).toBe(2);
});
<|fim_middle|>> {
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>t value = 1;
<|fim_prefix|>export default () => import("./c2");
<|fim_middle|>export cons<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>");
export const value = 2;
<|fim_prefix|>export default (<|fim_middle|>) => import("./c1<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
/** @type {import("../../../../").Configuration} */
module.exports = {
entry: {
bundle0: "./a",
bundle1: "./b"
},
optimization: {
flagIncludedChunks: false,
chunkIds: "named"
<|fim_suffix|>[name].js",
chunkFilename: "[id].[chunkhash].js"
}
};
<|fim_middle|>},
output: {
fil... | fim | webpack/webpack | javascript |
<|fim_suffix|>ould not emit error when running a.js (runtime a)", () => {
expect(utilA()).toBe("a");
})
<|fim_prefix|>import { utilA } from "./lib"<|fim_middle|>
it("sh<|endoftext|> | fim | webpack/webpack | javascript |
import { utilB } from "./lib"
it("should not emit error when running b.js (runtime b)", () => {
expect(utilB()).toBe("[object Object] common");
})
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|> 'common'
<|fim_prefix|>export const common<|fim_middle|> =<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>export<|fim_suffix|>rom "./empty"<|fim_middle|> * from "./common"
export * f<|endoftext|> | fim | webpack/webpack | javascript |
export * from "./util-a"
export * from "./common"
export * from "./util-b"
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|> {
return 'a';
}
<|fim_prefix|>export function uti<|fim_middle|>lA()<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>mization from SideEffectsFlagPlugin
export function utilB() {
return b + ' ' + common;
}
<|fim_prefix|>import { common } from "./common"
var b = ({}).toString(); // side effect, this wi<|fim_middle|>ll keep lib/index.js exist in the output, bailout the opti<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use st<|fim_suffix|>;
<|fim_middle|>rict";
module.exports = {
findBundle() {
return ["./lib.js", "./a.js", "./b.js"];
}
}<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>
minSize: 0
}
}
}
}
};
<|fim_prefix|>"use strict";
/** @type {import("webpack").Configuration} */
module.exports = {
entry: {
a: "./a.js",
b: "./b.js"
},
output: {
filename: "[name]<|fim_middle|>.js"
},
target: "web",
mode: "production",
optimization: {
concatenateModules: f... | fim | webpack/webpack | javascript |
<|fim_prefix|>import { val, val2b } from "./shared";
it("should have the correct value", () => {
expect(val).toBe(84<|fim_suffix|>pect(val2b).toBe(42);
});
<|fim_middle|>);
ex<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>import { val, val2b } from "./concatenated-shared";
it("should have the correct valu<|fim_suffix|>.toBe(84);
expect(val2b).toBe(42);
});
<|fim_middle|>e", () => {
expect(val)<|endoftext|> | fim | webpack/webpack | javascript |
import { other, val2c, Test } from "./shared";
it("should have the correct value", () => {
expect(other).toBe("other");
expect(val2c).toBe(42);
expect(Test).toBeTypeOf("function");
expect(new Test()).toBeInstanceOf(Test);
});
<|endoftext|> | fim | webpack/webpack | javascript |
import { other, val2c, Test } from "./concatenated-shared";
it("should have the correct value", () => {
expect(other).toBe("other");
expect(val2c).toBe(42);
expect(Test).toBeTypeOf("function");
expect(new Test()).toBeInstanceOf(Test);
});
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>toBe("other");
});
<|fim_prefix|>import { other } from "./<|fim_middle|>shared";
it("should have the correct value", () => {
expect(other).<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|><|fim_prefix|>export * from "./shared?1";<|fim_middle|>
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>import { other } from "./concatenated-shar<|fim_suffix|> value", () => {
expect(other).toBe("other");
});
<|fim_middle|>ed";
it("should have the correct<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>import { value2, value3 } from "./shared2";
it("should have the correct<|fim_suffix|>3).toBe(42);
});
<|fim_middle|> value", () => {
expect(value2).toBe(42);
expect(value<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>import { other2, value3 } from "./shared2";
it("should have the<|fim_suffix|> expect(other2).toBe("other");
expect(value3).toBe(42);
});
<|fim_middle|> correct value", () => {
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>import { setOther2 } from "./shared2";
export<|fim_suffix|>Other2("wrong");
<|fim_middle|> default 42;
set<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>t 42;
<|fim_prefix|>export d<|fim_middle|>efaul<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>export <|fim_suffix|>2;
<|fim_middle|>default 4<|endoftext|> | fim | webpack/webpack | javascript |
module.exports = 42;
<|endoftext|> | fim | webpack/webpack | javascript |
import value from "./dep";
import value2 from "./dep2";
import * as dep2 from "./dep2";
import Super from "./super";
const derived = value;
export const val = /*#__PURE__*/ (() => value + derived)();
export const val2a = value2;
export const val2b = value2;
export const val2c = value2;
export const other = "other";... | fim | webpack/webpack | javascript |
<|fim_prefix|>import value from "./dep-shared3";<|fim_suffix|> "./dep-shared4";
export function setOther2(value) {
other2 = value;
}
export const value2 = value;
export const value3 = value4;
export var other2;
if (other2 === undefined) other2 = "other";
<|fim_middle|>
import value4 from<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>t default class Super {}
<|fim_prefix|>e<|fim_middle|>xpor<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
module.exports = {
fi<|fim_suffix|>}
};
<|fim_middle|>ndBundle() {
return [
"shared.js",
"a.js",
"b.js",
"c1.js",
"c2.js",
"ax.js",
"bx.js",
"cx1.js",
"cx2.js",
"d1.js",
"d2.js"
];
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|><|fim_prefix|>"use strict";
/** @type {import("../../../../").Configuration} */
module.exports = {
entry: {
a: "./a",
b: "./b",
c1: "./c",
c2: "./c",
ax: "./ax",
bx: "./bx",
cx1: "./cx",
cx2: "./cx",
d1: "./d1",
d2: "./d2"
},
target: "web",
output: {
filename: "[name].js",
lib... | fim | webpack/webpack | javascript |
<|fim_prefix|>import<|fim_suffix|>56');
});
<|fim_middle|> { value } from "./shared-c";
it("should have to correct value", () => {
expect(value).toBe('issue-118<|endoftext|> | fim | webpack/webpack | javascript |
import { value } from "./shared-d";
it("should have to correct value", () => {
expect(value).toBe('issue-11856');
});
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>export *<|fim_suffix|>rom "./shared-d";
<|fim_middle|> f<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>export co<|fim_suffix|>ssue-11856';
<|fim_middle|>nst value = 'i<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>
<|fim_prefix|>"use strict";
module.exports = {
findBundle() {<|fim_middle|>
return ["shared.js", "a.js", "b.js"];
}
};<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>}
}
}
};
<|fim_prefix|>"use strict";
/** @type {import("../../../../").Configuration} */
module.exports = {
entry: {
a: "./a",
b: "./b"
},
target: "web",
output: {
filename: "[name].js",
library: { type: "commonjs-module" }
},
optimization: {
usedExports: true,
concatenateModules: tr... | fim | webpack/webpack | javascript |
<|fim_prefix|>import { value } fro<|fim_suffix|> to correct value", () => {
expect(value).toBe('issue-11856.2');
});
<|fim_middle|>m "./shared-c";
it("should have<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>import<|fim_suffix|>"./b2";
it("should have to correct value", () => {
expect(value).toBe('issue-11856.2');
});
<|fim_middle|> { value } from <|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>e";
<|fim_prefix|>export * from "./sha<|fim_middle|>red-<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>red-d";
<|fim_prefix|>export <|fim_middle|>* from "./sha<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>export * from <|fim_suffix|>e";
<|fim_middle|>"./shared-<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>.2';
<|fim_prefix|>export const value = 'issu<|fim_middle|>e-11856<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>ons) {
return ["shared.js", "a.js", "b.js"];
}
};
<|fim_prefix|><|fim_middle|>"use strict";
module.exports = {
findBundle: function (i, opti<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
/** @type {import("../../../../").Configuration} */
module.exports = {
entry: {
a: "./a",
b: "./b"
},
target: "web",
output: {
filename: "[name].js",
library: { type: "commonjs-module" }
},
optimization: {
usedExports: true,
<|fim_suffix|> chunks: "all"
}
}
}
}
};... | fim | webpack/webpack | javascript |
<|fim_suffix|>e1).toBe('issue-11863');
});
<|fim_prefix|>import { value1 } from "./shared";
it("should have to<|fim_middle|> correct value", () => {
expect(valu<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>import { value2 } from "./shared";
it("should have to correct value", ()<|fim_suffix|>ue2).toBe('issue-11863');
});
<|fim_middle|> => {
expect(val<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>o correct value", () => {
expect(value3).toBe('issue-11863');
});
<|fim_prefix|>import { value3 } from "./shared"<|fim_middle|>;
it("should have t<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>export const value1 <|fim_suffix|>';
export const value3 = 'issue-11863';
<|fim_middle|>= "issue-11863";
export const value2 = 'issue-11863<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>from "./shared-x";
<|fim_prefix|>export { <|fim_middle|>value3 } <|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>export { value1 <|fim_suffix|>om "./shared-x";
<|fim_middle|>} fr<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>expo<|fim_suffix|>red-y";
<|fim_middle|>rt { value1 } from "./shared-z";
export { value2 } from "./shared-x";
export * from "./sha<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
module.exports = {
findBundle() {
return [
"shared.js",
"a.js",
<|fim_suffix|>js",
"ab.js",
"ac.js",
"bc.js",
"abc.js"
];
}
};
<|fim_middle|> "b.js",
"c.<|endoftext|> | fim | webpack/webpack | javascript |
"use strict";
/** @type {import("../../../../").Configuration} */
module.exports = {
entry: {
a: "./a",
b: "./b",
c: "./c",
ab: ["./a", "./b"],
ac: ["./a", "./c"],
bc: ["./b", "./c"],
abc: ["./a", "./b", "./c"]
},
target: "web",
output: {
filename: "[name].js",
library: { type: "commonjs-module" ... | fim | webpack/webpack | javascript |
<|fim_suffix|>le.id;
<|fim_prefix|>module.expor<|fim_middle|>ts = modu<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>rts = module.id;
<|fim_prefix|>modu<|fim_middle|>le.expo<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>module.exports = mo<|fim_suffix|>le.id;
<|fim_middle|>du<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|><|fim_prefix|>module.exports = module.id;<|fim_middle|>
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|> module.id;
<|fim_prefix|>module.exports<|fim_middle|> =<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>module.exports<|fim_suffix|>e.id;
<|fim_middle|> = modul<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>modu<|fim_suffix|>;
<|fim_middle|>le.exports = module.id<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>ule.id;
<|fim_prefix|>m<|fim_middle|>odule.exports = mod<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>.id;
<|fim_prefix|>module.expo<|fim_middle|>rts = module<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>module.exports = modul<|fim_suffix|>;
<|fim_middle|>e.id<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>module.exports =<|fim_suffix|>odule.id;
<|fim_middle|> m<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>module.expo<|fim_suffix|>= module.id;
<|fim_middle|>rts <|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>module.exports <|fim_suffix|>
<|fim_middle|>= module.id;<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>module.exports <|fim_suffix|>.id;
<|fim_middle|>= module<|endoftext|> | fim | webpack/webpack | javascript |
module.exports = module.id;
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>it("debug hash should works", function () {
var <|fim_suffix|>id);
}
});
<|fim_middle|>ids = [];
for(var i = 1; i <= 15; i++) {
var id = require("./files/file" + i + ".js");
expect(ids.indexOf(id)).toBe(-1);
ids.push(<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
/** @<|fim_suffix|>t("../../../../").Configuration[]} */
module.exports = [
{
output: {
hashFunction: "debug"
}
}
];
<|fim_middle|>type {impor<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>module.expor<|fim_suffix|>module.id;
<|fim_middle|>ts = <|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|><|fim_prefix|>m<|fim_middle|>odule.exports = module.id;
<|endoftext|> | fim | webpack/webpack | javascript |
module.exports = module.id;
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>ts = module.id;
<|fim_prefix|>module.exp<|fim_middle|>or<|endoftext|> | fim | webpack/webpack | javascript |
module.exports = module.id;
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>e.id;
<|fim_prefix|><|fim_middle|>module.exports = modul<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>ports = module.id;
<|fim_prefix|>m<|fim_middle|>odule.ex<|endoftext|> | fim | webpack/webpack | javascript |
module.exports = module.id;
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>= module.id;
<|fim_prefix|>module.exports<|fim_middle|> <|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>module.expo<|fim_suffix|>id;
<|fim_middle|>rts = module.<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>s = module.id;
<|fim_prefix|>module.exp<|fim_middle|>ort<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|><|fim_prefix|>module.exports<|fim_middle|> = module.id;
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|><|fim_suffix|>;
<|fim_middle|>module.exports = module.id<|endoftext|> | fim | webpack/webpack | javascript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.