text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
<|fim_suffix|>public/path/chunk1-css.css");
expect(link.crossOrigin).toBe("anonymous");
const promise5 = import(/* webpackChunkName: "chunk2-css", webpackPrefetch: true */ "./chunk2.css");
expect(document.head._children).toHaveLength(6);
link = document.head._children[5];
expect(link._type).toBe("link... | fim | webpack/webpack | javascript |
"use strict";
/** @type {import("../../../../").Configuration} */
module.exports = {
entry: "./index.mjs",
experiments: {
outputModule: true,
css: true
},
name: "esm",
target: "web",
output: {
publicPath: "",
module: true,
filename: "bundle0.mjs",
chunkFilename: "[name].mjs",
crossOriginLoading: "a... | fim | webpack/webpack | javascript |
<|fim_prefix|>import * as style from "./style.modu<|fim_suffix|>css?imported";
export default Object(style);
<|fim_middle|>le.<|endoftext|> | fim | webpack/webpack | javascript |
it("should allow to dynamic import a css module", done => {
__non_webpack_require__("./style_module_css.bundle0.js");
import("./style.module.css").then(x => {
try {
expect(x).toEqual(
nsObj({
a: "a",
abc: "a b c",
comments: "abc/****/ /* hello world *//****/ def",
whitespace: "abc\n\t... | fim | webpack/webpack | javascript |
<|fim_suffix|>eexported";
<|fim_prefix|>export * from <|fim_middle|>"./style.module.css?r<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>rget: "web",
mode: "development",
experiments: {
css: true
}
};
<|fim_prefix|>"use strict";
/** @type {import("<|fim_middle|>../../../../").Configuration} */
module.exports = {
ta<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>import './style.modules.css';
it("should compile", () => {
const links = document.getElementsByTagName(<|fim_suffix|>lassName": "reexport_modules_css_d342-className",
"primary-color": "red",
"secondary-color": "block",
}));
} catch(e) {
done(e);
return;
}
done()
}, done)
});
<|f... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
module.exports = {
findBundle() {
return ["reexpo<|fim_suffix|>0.js"];
},
moduleScope(scope) {
const link = scope.window.document.createElement("link");
link.rel = "stylesheet";
link.href = "bundle0.css";
scope.window.document.head.appendChild(link);
}
};
<|fim_middle|>rt_modu... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
/** @type {import(".<|fim_suffix|>orts = {
target: "web",
mode: "development",
experiments: {
css: true
}
};
<|fim_middle|>./../../../").Configuration} */
module.exp<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>;
it("should resolve :import/:export when two async chunks import the same async-only module", (done) => {
Promise.all([
import("./async-a.modules.css"),
import("./async-b.modules.css")
]).then(([a, b]) => {
try {
expect(a).toEqual(
nsObj({
tone: "cyan",
"async-a": "async-a_modul... | fim | webpack/webpack | javascript |
<|fim_suffix|>;
},
moduleScope(scope) {
const link = scope.window.document.createElement("link");
link.rel = "stylesheet";
link.href = "bundle0.css";
scope.window.document.head.appendChild(link);
}
};
<|fim_prefix|>"use strict";
module.exports = {
findBundle() {
re<|fim_middle|>turn [
"async-shared_mo... | fim | webpack/webpack | javascript |
<|fim_suffix|>kIds: "named"
},
experiments: {
css: true
}
};
<|fim_prefix|>"use strict";
/** @type {import("../../../../").Configuration} <|fim_middle|>*/
module.exports = {
target: "web",
mode: "development",
output: {
chunkFilename: "[name].chunk.js"
},
optimization: {
chun<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>et.css);
}
expect(css).toMatchSnapshot();
});
<|fim_prefix|>import "./style.css";
import "./nested/style.css";
it("should work", () => {
const links = document.getElementsByTagName("link");
const c<|fim_middle|>ss = [];
// Skip first because import it by default
for (const link of links.slice(1))... | fim | webpack/webpack | javascript |
<|fim_suffix|>ink);
}
};
<|fim_prefix|>"use strict";
module.exports = {
moduleScope(scope, options) {
const link = scope.window.document.createElement("link");
l<|fim_middle|>ink.rel = "stylesheet";
link.href = `bundle${options.name}.css`;
scope.window.document.head.appendChild(l<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
/** @typedef {import("../../../../").PathData} PathData */
const publicPaths = [
"auto",
"/",
"/static/img/",
"/static/img/../deep/",
"//cdn.webpack.js/assets/",<|fim_suffix|>esource",
generator: { filename: "[name][ext]" }
},
{
test: /nested_dir\.(svg)$/,
type: "ass... | fim | webpack/webpack | javascript |
<|fim_prefix|>import "./style.css";
it("should compile", done => {
const l<|fim_suffix|>
expect(css).toMatchSnapshot();
done();
});
<|fim_middle|>inks = document.getElementsByTagName("link");
const css = [];
// Skip first because import it by default
for (const link of links.slice(1)) {
css.push(link.sheet.cs... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
module.expo<|fim_suffix|> = {
moduleScope(scope) {
const link = scope.window.document.createElement("link");
link.rel = "stylesheet";
link.href = "bundle0.css";
scope.window.document.head.appendChild(link);
}
};
<|fim_middle|>rts<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>
experiments: {
css: true
}
};
<|fim_prefix|>"use strict";
/** @type {import("../../../../").Configuration} */
module.exports = {
target: "web",
mode: "development",
module: {
rules: <|fim_middle|>[
{
test: /\.css$/i,
type: "css"
}
]
},<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>import * as valid from "./valid.module.css";
import * as nocheck from "./no-check.module.css";
import * as autoPure from "./auto-pure.module.css";
import "./invalid.module.css";
impo<|fim_suffix|>=> {
expect(nocheck).toEqual(
nsObj({
ok: "no-check_module_css-ok"
})
);
});
it("should apply pure c... | fim | webpack/webpack | javascript |
<|fim_suffix|> },
type: "css/module"
},
{
// `css/auto` with `pure: true`: pure-check kicks in for
// filenames matching `IS_MODULES` (= `.modules?.<ext>`), and
// must NOT kick in for other filenames since the file isn't
// treated as a CSS module at all.
test: /auto-.*\.css$/,
pars... | fim | webpack/webpack | javascript |
<|fim_prefix|>import * as styles from "./styles.module.css";
it("should work with asset modules", async () => {
const links = [...document.getElementsB<|fim_suffix|>hSnapshot();
});
<|fim_middle|>yTagName("link")];
expect(links.find((item) => /bundle/.test(item.href)).sheet.css).toMatchSnapshot();
expect(styles).t... | fim | webpack/webpack | javascript |
"use strict";
module.exports = {
moduleScope(scope, options) {
const link = scope.window.document.createElement("link");
link.rel = "stylesheet";
link.href = options.output.filename.replace("js", "css");
scope.window.document.head.appendChild(link);
}
};
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
/** @type {import("../../../../").Configura<|fim_suffix|>mize: false
},
experiments: {
css: true
}
}));
<|fim_middle|>tion[]} */
module.exports = ["development", "production"].map((mode, idx) => ({
name: mode,
devtool: false,
entry: "./index.js",
mode,
target: "web",
output: {
... | fim | webpack/webpack | javascript |
<|fim_prefix|>import "./style.css";
it("should work", () => {
const computedStyle = getComputedStyle(document.body);
expect(computedStyle.getPropertyValue("co<|fim_suffix|>("background")).toBe(" red");
});
<|fim_middle|>lor")).toBe(" red");
expect(computedStyle.getPropertyValue<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
module.exports = {
moduleScope(scope) {
const link = scope.window.document.createElemen<|fim_suffix|>in");
scope.window.document.head.appendChild(link);
}
};
<|fim_middle|>t("link");
link.rel = "stylesheet";
link.href = "bundle0.css";
link.setAttribute("data-webpack", "test:chun... | fim | webpack/webpack | javascript |
<|fim_suffix|>place(
"head{",
".class, head, body{"
)}\n\n.after-head { color: red; }`
)
);
}
);
});
}
}
],
experiments: {
css: true
}
};
<|fim_prefix|>"use strict";
/** @type {import("../../../../").Configuration} */
module.exports = {
target: "web... | fim | webpack/webpack | javascript |
<|fim_suffix|>t(computedStyle.getPropertyValue("color")).toBe(" red");
expect(computedStyle.getPropertyValue("background")).toBe(" red");
});
<|fim_prefix|>import "./style.css";
it("should work", () => {
c<|fim_middle|>onst computedStyle = getComputedStyle(document.body);
expec<|endoftext|> | fim | webpack/webpack | javascript |
"use strict";
module.exports = {
moduleScope(scope) {
const link = scope.window.document.createElement("link");
link.rel = "stylesheet";
link.href = "bundle0.css";
scope.window.document.head.appendChild(link);
}
};
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>e
}
};
<|fim_prefix|>"use strict";
/** @type {import("../../../../").Configuration} */
module.exports = {
target: "web",
mode: "development",
output: {
uniqueName: "test"
},
plugins: [
{
apply(compiler) {
compiler.hooks.compilation.tap("Test", (compilation) => {
compilation.hooks.pr... | fim | webpack/webpack | javascript |
<|fim_suffix|>js";
export default style;<|fim_prefix|>i<|fim_middle|>mport * as style from "./styles.<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>yle;<|fim_prefix|>import * as style from "<|fim_middle|>./styles.js";
export default st<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>;
}, done);
});
<|fim_prefix|>const img = new URL("./img.png", import.meta.url);
it("should allow to create css modules", done => {
import("./asyncChunk").then(({ default: x }) => {
try {
expect(img.toString()).toBe("https://test.cases/pat<|fim_middle|>h/img.png");
expect(x.default.class).toEqu... | fim | webpack/webpack | javascript |
<|fim_prefix|>const img = new URL("./img.png", import.meta.url);
it("should allow to create css modules", done => {
import<|fim_suffix|>class).toEqual("test_module_css-class");
} catch (e) {
return done(e);
}
done();
}, done);
});
<|fim_middle|>("./asyncChunk2").then(({ default: x }) => {
try {
expect... | fim | webpack/webpack | javascript |
<|fim_prefix|>const foo = `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... | fim | webpack/webpack | javascript |
<|fim_suffix|>yle;<|fim_prefix|>im<|fim_middle|>port * as style from "./test.module.css";
export default st<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
module.exports = {
moduleScope(scope) {
const link1 = scope.window.document.createElement("link");
link1.rel = "stylesheet";
link1.href = "asyncChunk_js.css";
scope.window.do<|fim_suffix|>ink");
link2.rel = "stylesheet";
link2.href = "asyncChunk2_js.css";
scope.window.documen... | fim | webpack/webpack | javascript |
<|fim_suffix|>} */
module.exports = {
target: "web",
mode: "development",
experiments: {
css: true
},
entry: {
main: {
import: ["./share.js", "./entry1.js"]
},
secondMain: {
import: ["./share.js", "./entry2.js"]
}
},
optimization: {
splitChunks: {
chunks: "all",
cacheGroups: {
common:... | fim | webpack/webpack | javascript |
<|fim_suffix|>kage are
// dropped, matching Vite/Rollup/Rolldown's strict interpretation of the
// `sideEffects` field. Libraries that ship CSS through this pattern need
// to opt CSS in explicitly with `"sideEffects": ["**/*.css"]` (or use a
// `module.rules[].sideEffects` override).
it("drops CSS from a side-effect-o... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
module.exports = {
findBundle() {
return ["bundl<|fim_suffix|>.window.__cssLinkInjected = true;
const link = scope.window.document.createElement("link");
link.rel = "stylesheet";
link.href = "bundle0.css";
scope.window.document.head.appendChild(link);
}
};
<|fim_middle|>e0.js"];... | fim | webpack/webpack | javascript |
<|fim_suffix|>}
};
<|fim_prefix|>"use strict";
/** @type {import("../../../../").Configuration} */
module.exports = {
mode: "production",
target: "web",
devtool: false,
experiments: { css: true },
output: {
cssFilename: "bundle0.css"
},
optimization: {
sideEffects: true,
moduleIds: "named",
chunkIds: "n... | fim | webpack/webpack | javascript |
<|fim_suffix|>line/column at generated line ${line}`
);
}
referencedSources.add(prevSrc);
segmentsWithSource++;
}
if (fields.length === 5) {
prevName += fields[4];
if (prevName < 0 || prevName >= namesLen) {
throw new Error(
`Name index ${prevName} out of range (names: ${namesLen})`
... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const fs = require("fs");
const path = re<|fim_suffix|>__nodeFs = fs;
scope.__nodePath = path;
scope.__NodeBuffer = Buffer;
}
};
<|fim_middle|>quire("path");
module.exports = {
moduleScope(scope) {
scope.<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>cess.version.startsWith("v12.");
<|fim_prefix|>"use strict";
module.exports = ()<|fim_middle|> =>
!process.version.startsWith("v10.") && !pro<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>style-sheet", true)
];
<|fim_prefix|>"use strict";
const path = require("path");
/**
* @param {string} exportType the CSS parser exportType under test
* @param {boolean} useLess whether to compile through less-loader
* @returns {import("../../../../").Configuration} webpack co<|fim_middle|>nfiguratio... | fim | webpack/webpack | javascript |
<|fim_prefix|>import parent from "./parent.css";
// Reference the import so it isn't tree-shaken away — text and
// css-style-sheet are value-returning exportTypes whose CSS payload would
// otherwise be optimized out.
globalThis.__keepCssAlive = parent;
const fs = __nodeFs;
const path = __nodePath;
const NodeBuffer ... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const fs = require("fs");
const path = require("path");<|fim_suffix|>.__nodePath = path;
scope.__NodeBuffer = Buffer;
}
};
<|fim_middle|>
module.exports = {
moduleScope(scope) {
scope.__nodeFs = fs;
scope<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>r the same reason.
module.exports = () =>
!process.version.startsWith("v10.") && !process.version.startsWith("v12.");
<|fim_prefix|>"use strict";
// Skip on Node 10/12: this case uses `globalThis` (added in Node 12.0.0)
// and `String.prototype.matchAll` (added in Node 12.0.0). The sibling
// `source-ma... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
/**
* @param {"text" | "css-style-sheet"} exportType the CSS parser exportType
* @returns {import("../../../../").Configuration} webpack configuration
*/
const makeConfig = (exportType) => ({
name: exportType,
target: "web",
mode: "development",
devtool: "source-map",
modul<|fim_suf... | fim | webpack/webpack | javascript |
<|fim_suffix|> {
// `[file]__[local]` resolves to the same string on every target,
// so SSR and client hydrate with identical class names without
// needing css-loader's getJSON option to round-trip.
expect(styles.button).toBe("./style.module.css__button");
expect(styles.primary).toBe(
"./style.module.css__prim... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const common = {
mode: "developme<|fim_suffix|>nfiguration[]} */
module.exports = [
{
...common,
name: "web",
target: "web"
},
{
...common,
name: "node",
target: "node"
}
];
<|fim_middle|>nt",
devtool: false,
module: {
rules: [
{
test: /\.module\.css$/,
type:... | fim | webpack/webpack | javascript |
<|fim_prefix|>import * as pureStyle from "./style.css"<|fim_suffix|> };
});
expect(result).toBe(
"data: style_modules_css-foo style2_modules_css-bar style3_modules_css-baz, thanks"
);
await worker.terminate();
} else {
expect(true).toBe(true);
}
});
<|fim_middle|>;
import * as styles from "./style.module... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
module.exports = {
moduleScope(scope, options, env) {
if (env !== "node") {
const link = scope<|fim_suffix|>le0.css";
scope.window.document.head.appendChild(link);
}
}
};
<|fim_middle|>.window.document.createElement("link");
link.rel = "stylesheet";
link.href = "bund<|endo... | fim | webpack/webpack | javascript |
<|fim_prefix|><|fim_suffix|>r();
<|fim_middle|>"use strict";
const supportsWorker = require("../../../helpers/supportsWorker");
module.exports = () => supportsWorke<|endoftext|> | fim | webpack/webpack | javascript |
"use strict";
/** @type {import("../../../../").Configuration[]} */
module.exports = [
{
name: "web",
target: ["web", "node"],
devtool: false,
mode: "development",
experiments: {
css: true,
outputModule: true
}
},
{
name: "node",
target: ["web", "node"],
devtool: false,
mode: "development"... | fim | webpack/webpack | javascript |
<|fim_suffix|>oo } = await import("./style.modules.css");
const { bar } = await import("./style2.modules.css");
const { baz } = await import("./style3.modules.css");
postMessage(`data: ${foo} ${bar} ${baz}, thanks`);
};
<|fim_prefix|>self.onmessage = async event => {
<|fim_middle|> const { f<|endoftext|> | fim | webpack/webpack | javascript |
import "./style.css";
it(`should work with URLs in CSS`, () => {
const links = document.getElementsByTagName("link");
const css = [];
// Skip first because import it by default
for (const link of links.slice(1)) {
css.push(link.sheet.css);
}
expect(css).toMatchSnapshot();
});
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
module.exports = {
<|fim_suffix|>ppendChild(link);
}
};
<|fim_middle|>moduleScope(scope) {
const link = scope.window.document.createElement("link");
link.rel = "stylesheet";
link.href = `bundle${scope.__STATS_I__}.css`;
scope.window.document.head.a<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>e, "img.png"),
"alias-url-1.png": false
}
},
externals: {
"external-url.png": "asset ./img.png",
"external-url-2.png": "test",
"schema:test": "asset 'img.png'"
},
plugins: [new webpack.IgnorePlugin({ resourceRegExp: /ignore\.png/ })]
},
{
target: "web",
mode: "development",
... | fim | webpack/webpack | javascript |
<|fim_suffix|>});
const style1 = getComputedStyle(h1);
expect(style1).toMatchSnapshot();
const style2 = getComputedStyle(h2);
expect(style2).toMatchSnapshot();
const style3 = getComputedStyle(h3);
expect(style3).toMatchSnapshot();
done();
} catch (e) {
done(e);
}
}, done);
});
<|fim_prefix|... | fim | webpack/webpack | javascript |
<|fim_suffix|>trict";
module.exports = {
findBundle(i) {
return [`index_css.bundle${i}.js`, `bundle${i}.js`];
}
};
<|fim_prefix|>"u<|fim_middle|>se s<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>cases/path/bundle2/assets/"
}
}
]
}
}
];
<|fim_prefix|>"use strict";
/** @type {import("../../../../").Configuration} */
const common = {
target: "web",
mode: "development",
devtool: false,
experiments: {
css: true
}
};
/** @type {import("../../../../").Configuration} */
module.exp... | fim | webpack/webpack | javascript |
<|fim_suffix|>ot();
done();
});
<|fim_prefix|>import "./style.css";
it("should compile", done => {
const links = document.getElementsByTagName("link");
const css <|fim_middle|>= links[1].sheet.css;
expect(css).toMatchSnapsh<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
modu<|fim_suffix|>ndow.document.head.appendChild(link);
}
};
<|fim_middle|>le.exports = {
moduleScope(scope) {
const link = scope.window.document.createElement("link");
link.rel = "stylesheet";
link.href = "bundle0.css";
scope.wi<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use st<|fim_suffix|>../../../../").Configuration} */
module.exports = {
target: "web",
mode: "development",
experiments: {
css: true
}
};
<|fim_middle|>rict";
/** @type {import("<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>import * as style from "./style.modules.css";
it("should allow to impor<|fim_suffix|>xpect(style.header).toContain("base");
});
<|fim_middle|>t a css module", () => {
expect(style.header).toContain("header");
e<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>get: "webworker",
mode: "development",
devtool: false,
experiments: {
css: true
}
};
<|fim_prefix|>"use strict";
/** @type {import("../../../../").Configuratio<|fim_middle|>n} */
module.exports = {
tar<|endoftext|> | fim | webpack/webpack | javascript |
import toml from "../_files/data.toml";
it("should transform toml to json", () => {
expect(toml).toMatchObject({
title: "TOML Example",
owner: {
name: 'Tom Preston-Werner',
organization: 'GitHub',
bio: 'GitHub Cofounder & CEO\nLikes tater tots and beer.',
dob: '1979-05-27T07:32:00.000Z'
}
});
});
<... | fim | webpack/webpack | javascript |
<|fim_suffix|>ms
expect(arguments).toHaveLength(1);
return toml.parse(input);
}
}
}
]
}
}
];
<|fim_prefix|>"use strict";
const toml = require("toml");
/** @typedef {import("../../../../").ParserOptionsByModuleTypeKnown} ParserOptionsByModuleTypeKnown */
/** @type {import("../../../... | fim | webpack/webpack | javascript |
<|fim_suffix|>s = [{ code: /DEP_WEBPACK_CHUNK_TEMPLATE_RENDER_MANIFEST/ }];
<|fim_prefix|>"use <|fim_middle|>strict";
module.export<|endoftext|> | fim | webpack/webpack | javascript |
it("should generate the correct output files", () => {
// It should not generate a JS chunk file for the localization-only chunk
expect(
__STATS__.children[INDEX].assets.map(asset => asset.name).sort()
).toEqual(
[
NORMAL1 && `286.bundle${INDEX}.js`,
NORMAL2 && `678.bundle${INDEX}.js`,
`bundle${INDEX}.j... | fim | webpack/webpack | javascript |
<|fim_prefix|>expor<|fim_suffix|>42;
<|fim_middle|>t default <|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>export<|fim_suffix|>default 43;
<|fim_middle|> <|endoftext|> | fim | webpack/webpack | javascript |
"use strict";
const { RawSource } = require("webpack-sources");
const Generator = require("../../../../").Generator;
const RuntimeModule = require("../../../../").RuntimeModule;
const RuntimeGlobals = require("../../../../").RuntimeGlobals;
const Parser = require("../../../../").Parser;
const webpack = require("../../... | fim | webpack/webpack | javascript |
<|fim_prefix|>import { test, unused } from "./module";
it("should run the test", () => {
expect(test()).toEqu<|fim_suffix|>ect(unused).toEqual(undefined);
});
<|fim_middle|>al({
used: "used",
unused: undefined
});
exp<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>port { unused }
<|fim_prefix|>import { used, unu<|fim_middle|>sed } from "./reference";
export function test() {
return {
used,
unused
};
}
ex<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>= "used";
export var unused = "unused";
<|fim_prefix|>export var us<|fim_middle|>ed <|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>ef : ref.name;
return names.length === 1 && names[0] === "unused";
})
) {
return referencedExports.filter((ref) => {
const names = Array.isArray(ref) ? ref : ref.name;
return names.length !== 1 || names[0] !== "unused";
});
}
return referenced... | fim | webpack/webpack | javascript |
import { test, unused } from "./module";
it("should run the test", () => {
expect(test()).toEqual({
used: "used",
unused: undefined
});
expect(unused).toEqual(undefined);
});
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>import { used, u<|fim_suffix|>est() {
return {
used,
unused
};
}
export { unused }
<|fim_middle|>nused } from "./reference";
export function t<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>ex<|fim_suffix|>port var unused = "unused";
<|fim_middle|>port var used = "used";
ex<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
/** @typedef {import("../../../../").Compilation} Compilation */
/** @typedef {import("../../../../").Module} Module */
/** @type {import("../../../../").Configuration} */
module.exports = {
optimization: {
usedExports: true,
concatenateModules: true,
sideEffects: false
},
plugins... | fim | webpack/webpack | javascript |
<|fim_prefix|>it("s<|fim_suffix|>ould compile and run the test", function() {
});
<|fim_middle|>h<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>mpile when the object is not cloned
};
<|fim_prefix|>"use strict";
/** @type {import("../../../../").Configuration} */
module.exports = <|fim_middle|>{
resolve: Object.freeze({})
// this fails to co<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>// `import defer` coverage for every asset module type webpack supports.
// The TC39 import-defer proposal mandates that the deferred namespace expose
// the same exports with the same values as the eager (non-defer) form. Asset
// modules have no observable evaluation side effects, so the deferred and
//... | fim | webpack/webpack | javascript |
<|fim_suffix|> produces a Uint8Array (asset/bytes), and the
// asset/source assertion uses `TextDecoder` to compare bytes to text.
module.exports = () => supportsTextDecoder();
<|fim_prefix|>"use strict";
const supportsTextD<|fim_middle|>ecoder = require("../../../helpers/supportsTextDecoder");
// `with { type: "byte... | fim | webpack/webpack | javascript |
<|fim_suffix|>ilename: "[hash][ext]"
},
experiments: {
deferImport: true
}
};
<|fim_prefix|>"use strict";
/** @type {import("../../../../").Configuration} */
module.exports = {
target: [`async-node${process.versions.node.split(".").map(Number)[0]}`],
module: {
rules: [
{
test: /\.svg$/,
oneOf: [
... | fim | webpack/webpack | javascript |
<|fim_prefix|>import bytes from "./payload.txt<|fim_suffix|>counter.cjs";
touch();
export default bytes;
<|fim_middle|>?wrap-bytes" with { type: "bytes" };
import { touch } from "./side-effect-<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>import dataUri from "./payload.svg?inline&w<|fim_suffix|>ri;
<|fim_middle|>rap-inline";
import { touch } from "./side-effect-counter.cjs";
touch();
export default dataU<|endoftext|> | fim | webpack/webpack | javascript |
import url from "./payload.svg?wrap-resource";
import { touch } from "./side-effect-counter.cjs";
touch();
export default url;
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>.txt" with { type: "text" };
import { touch } from "./side-effect-counter.cjs";
touch();
export default text;
<|fim_prefix|>import te<|fim_middle|>xt from "./payload<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>export {};
__configCases__deferImport__proposal.push("START async-mod-dep.js");
__<|fim_suffix|>_deferImport__proposal.push("END async-mod-dep.js");
<|fim_middle|>configCases_<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>onfigCases__deferImport__proposal.push("END async-mod.js");
<|fim_prefix|>imp<|fim_middle|>ort "./async-mod-dep.js";
__configCases__deferImport__proposal.push("START async-mod.js");
await 0;
export let x = 2;
__c<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>rImport__proposal.push("END deep-async-dep.js");
<|fim_prefix|>export {};
__configCases__deferImport__proposal.p<|fim_middle|>ush("START deep-async-dep.js");
await 0;
__configCases__defe<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>s__deferImport__proposal.push("END deep-async.js");
<|fim_prefix|>import "./dee<|fim_middle|>p-async-dep.js";
__configCases__deferImport__proposal.push("START deep-async.js");
export let x = 3;
__configCase<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>import * as fullSync from /* webpackDefer: true */ "./full-sync.js";
import * as asyncMod from /* webpackDefer: true */ "./async-mod.js";
import * as deepAsync from /* webpackDefer: true */ "./deep-async.js";
import * as reexportAsync f<|fim_suffix|>figCases__deferImport__proposal.push("END entry.js");
<|... | fim | webpack/webpack | javascript |
<|fim_suffix|>nfigCases__deferImport__proposal.push("END full-sync-dep.js");
<|fim_prefix|>export {};
__configCases__deferImport__proposal.push("START full-sync-dep.js"<|fim_middle|>);
__co<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>import "./full-sync-dep.js";
__configCases__deferImport__proposal.push("START full-sync.js");
export let x = 1;
__configCases__deferImpor<|fim_suffix|>);
<|fim_middle|>t__proposal.push("END full-sync.js"<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>.toEqual([
"START reexport-async-dep.js",
"END reexport-async-dep.js",
]);
});
<|fim_prefix|>it("should compile", async () => {
const logs = global.__configCases__deferImport__proposal = [];
// change to other way if webpack in the future rejects require a TLA esm.
let mod = require("./entry.js")... | fim | webpack/webpack | javascript |
<|fim_suffix|>posal.push("END reexport-async-dep-inner.js");
<|fim_prefix|>__configCases__deferImport__proposal.pus<|fim_middle|>h("START reexport-async-dep-inner.js");
export const x = await 4;
__configCases__deferImport__pro<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>export * from "./r<|fim_suffix|>s";
__configCases__deferImport__proposal.push("START reexport-async-dep.js");
__configCases__deferImport__proposal.push("END reexport-async-dep.js");
<|fim_middle|>eexport-async-dep-inner.j<|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.