text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
<|fim_prefix|>expo<|fim_suffix|>";
<|fim_middle|>rt default "a<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>default "b";
<|fim_prefix|>export<|fim_middle|> <|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>export const trim = (str) => str.trim()<|fim_suffix|><|fim_middle|>;<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>0],
10
);
return nodeVersionMajor >= 14;
};
<|fim_prefix|>"use strict";
module.exports = () => {
const nodeVersionMajor = Number.parseInt(
process.version.slice(1).spl<|fim_middle|>it(".")[<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>211566/tsconfig-json-buildno-inputs-were-found-in-config-file
<|fim_prefix|>// https://stackoverflow.com/q<|fim_middle|>uestions/41<|endoftext|> | fim | webpack/webpack | typescript |
<|fim_suffix|>.experiments.schemes.VirtualUrlPlugin(
{
"my-module": `const msg = "from virtual module with custom scheme";
export default msg`
},
"my-custom-scheme"
)
]
});
module.exports = config;
<|fim_prefix|>"use strict";
const fs = require("fs");
const path = require("path");
const webpack = req... | fim | webpack/webpack | javascript |
<|fim_suffix|>mmon");<|fim_prefix|>require(".<|fim_middle|>./build-co<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>import { greeting } from "./pkg";
document.write(gree<|fim_suffix|>ing('Bob'));
<|fim_middle|>t<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>/* tslint:disable */
/* eslint-disable */
/**
* @param {string} name
* @returns {string<|fim_suffix|>ction greeting(name: string): string;
<|fim_middle|>}
*/
export fun<|endoftext|> | fim | webpack/webpack | typescript |
<|fim_prefix|>import * as <|fim_suffix|>hi_wasm_bg.wasm";
export * from "./hi_wasm_bg.js";<|fim_middle|>wasm from "./<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>import * as wasm from './hi_wasm_bg.wasm';
let WASM_VECTOR_LEN = 0;
let cachegetUint8Memory0 = null;
function getUint8Memory0() {
if (cachegetUi<|fim_suffix|>ar r1 = getInt32Memory0()[retptr / 4 + 1];
return getStringFromWasm0(r0, r1);
} finally {
wasm.__wbindgen_add_to_stack_poi... | fim | webpack/webpack | javascript |
<|fim_prefix|>/* tslint:disable */
/* eslint-disable */
export const memory: WebAssembly.Memory;
export function greeting(a: number, b: number, c: number): void;
export function __wbindgen_add_to_stack_pointer(a: number): number;
export function __wbindgen_malloc(a: number): number;
export function __wbindgen_realloc<|... | fim | webpack/webpack | typescript |
<|fim_prefix|>"use st<|fim_suffix|>orts = () => supportsWebAssembly();
<|fim_middle|>rict";
const supportsWebAssembly = require("../../test/helpers/supportsWebAssembly");
module.exp<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
/** @type {import("<|fim_suffix|>lename consistent between different modes (for example building only)
},
experiments: {
asyncWebAssembly: true
}
};
module.exports = config;
<|fim_middle|>webpack").Configuration} */
const config = {
// mode: "development || "production",
output: {
... | fim | webpack/webpack | javascript |
require("../build-common");<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>import { get, set, getNumber } from "./magic.js";
// accessing memory
console.log(get());
set(42);
console.log(get());
set(123);
co<|fim_suffix|>);
console.log(getNumber());
<|fim_middle|>nsole.log(get());
// random numbers
console.log(getNumber());
console.log(getNumber()<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>export function getNumber() {
return 42;
}
export function getRandomNumber() {
return Math.f<|fim_suffix|>Math.random() * 256);
}
<|fim_middle|>loor(<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>gic.wat";
<|fim_prefix|>// reexporting
export * fro<|fim_middle|>m "./ma<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>async function getMemoryFromParentInWorker() {
await new Promise(r<|fim_suffix|>ial: 1 });
}
export const memory = await getMemoryFromParentInWorker();
<|fim_middle|> => setTimeout(r, 200));
// fake
return new WebAssembly.Memory({ init<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>WebAssembly = require("../../test/helpers/supportsWebAssembly");
module.exports = () => supportsWebAssembly();
<|fim_prefix|>"use strict";
co<|fim_middle|>nst supports<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>orts = config;
<|fim_prefix|>"use strict";
/** @type {import("webpack").Configuration} */
const config = {
// mode: "development" || "production",
output: {
publicPath: "dist/"
},
module: {
rules: [
{
test: /\.wa<|fim_middle|>t$/,
use: "wast-loader",
type: "webassembly/async"
}
... | fim | webpack/webpack | javascript |
<|fim_prefix|>require("../build-<|fim_suffix|>);<|fim_middle|>common"<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>e.time(name);
for (var i = 0; i < 5000; i++) fn();
console.timeEnd(name);
}
<|fim_prefix|>import { add } from "./add.wasm";
import {
add as mathAdd,
factorial,
factorialJavascript,
fibonacci,
fibonacciJavascript
} from "./<|fim_middle|>math";
console.log(add(22, 2200));
console.log(mathAdd(10, 101... | fim | webpack/webpack | javascript |
<|fim_prefix|>import { add }<|fim_suffix|>Javascript(i - 1);
}
export function fibonacciJavascript(i) {
if (i < 2) return 1;
return fibonacciJavascript(i - 1) + fibonacciJavascript(i - 2);
}
<|fim_middle|> from "./add.wasm";
import { factorial } from "./factorial.wasm";
import { fibonacci } from "./fibonacci.wasm";
... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const supportsWebAssembly = require("<|fim_suffix|>ule.exports = () => supportsWebAssembly();
<|fim_middle|>../../test/helpers/supportsWebAssembly");
mod<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
/** @type {import("webpack").Configuration} */
const config = {
// mode: "development" || "production",
output: {
webassemblyModuleFilen<|fim_suffix|>
experiments: {
asyncWebAssembly: true
}
};
module.exports = config;
<|fim_middle|>ame: "[hash].wasm",
publicPath: "dist/"
},
mo... | fim | webpack/webpack | javascript |
<|fim_suffix|>common");<|fim_prefix|>require("../bui<|fim_middle|>ld-<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>import<|fim_suffix|>ar i = 0; i < 10; i++) fn();
console.time(name);
for (var i = 0; i < 5000; i++) fn();
console.timeEnd(name);
}
<|fim_middle|> source wasmModule from "./add.wasm";
import {
add as mathAdd,
factorial,
factorialJavascript,
fibonacci,
fibonacciJavascript
} from "./math";
const { a... | fim | webpack/webpack | javascript |
<|fim_prefix|>import source addWasmModule from "./add.wasm";
import source factorialWasmModule from "./factorial.wasm";
import source fibonacciWasmModule from "./fibonacci.wasm";
export const { add } = new WebAssembly.Instance(addWasmModule).exports;
export const { factorial } = new WebAssembly.Instance(factorialWasmM... | fim | webpack/webpack | javascript |
<|fim_suffix|>helpers/supportsWebAssembly");
module.exports = () => supportsWebAssembly();
<|fim_prefix|>"use strict";
const supportsWebAssembly = <|fim_middle|>require("../../test/<|endoftext|> | fim | webpack/webpack | javascript |
"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:... | fim | webpack/webpack | javascript |
<|fim_prefix|><|fim_suffix|>common");
<|fim_middle|>global.NO_TARGET_ARGS = true;
global.NO_PUBLIC_PATH = true;
require("../build-<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>om) => {
if (history.length > 10) history.shift();
history.push(`${from}: ${content}`);
};
<|fim_prefix|>export const <|fim_middle|>history = [];
export const add = (content, fr<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>ry",
history
});
break;
}
};
}
};
<|fim_prefix|>import { history, add } from "./chat-module";
onconnect = function (e) {
for (const port of e.ports) {
port.on<|fim_middle|>message = event => {
const msg = event.data;
switch (msg.type) {
case "message":
add(msg.cont... | fim | webpack/webpack | javascript |
<|fim_suffix|>} catch (e) {
output1.innerText = e.message;
}
});
/// FIBONACCI with worker ///
const fibWorker = new Worker(new URL("./fib-worker.js", import.meta.url), {
name: "fibonacci",
type: "module"
/* webpackEntryOptions: { filename: "workers/[name].js" } */
});
fib2.addEventListener("change", () => {
... | fim | webpack/webpack | javascript |
onmessage = async event => {
const { fibonacci } = await import("./fibonacci");
const value = JSON.parse(event.data);
postMessage(`fib(${value}) = ${fibonacci(value)}`);
};
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>export function fibonacci(n) {
return n < 1 ? 0 : n <= 2 ?<|fim_suffix|> 2);
}
<|fim_middle|> 1 : fibonacci(n - 1) + fibonacci(n -<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"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: tr... | fim | webpack/webpack | javascript |
<|fim_suffix|>
},
exclude: [/^devServer in WebpackOptions /],
include: [/^(_module|_compilation|_compiler) in NormalModuleLoaderContext /]
};
<|fim_prefix|>"use strict";
module.exports = {
nameMapping: {
FsStats: /^Stats <|fim_middle|>Import fs/,
validateFunction: /^validate Import/,
Configuration: /^Webpack... | fim | webpack/webpack | javascript |
<|fim_suffix|>) {
check();
}
require("./log-apply-result")(updatedModules, updatedModules);
if (upToDate()) {
log("info", "[HMR] App is up to date.");
}
})
.catch(function (err) {
var status = module.hot.status();
if (["abort", "fail"].indexOf(status) >= 0) {
log(
"w... | fim | webpack/webpack | javascript |
<|fim_suffix|><|fim_prefix|>if (typeof EventTarget !== "function") {
throw new Error(
"Environment doesn't support lazy compilation (requires EventTarget)"
);
}
module.exports = n<|fim_middle|>ew EventTarget();
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>v<|fim_suffix|>();
<|fim_middle|>ar EventEmitter = require("events");
module.exports = new EventEmitter<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>ent.request(
urlBase + data,
{
agent: false,
headers: { accept: "text/event-stream" }
},
function (res) {
response = res;
response.on("error", errorHandler);
if (!options.active && !options.module.hot) {
console.log(
"Hot Module Replacement is not enabled. Waiti... | fim | webpack/webpack | javascript |
<|fim_suffix|>le.exports = handler;
<|fim_prefix|>"use strict";
/* global __resourceQuery */
var isNodeLikeEnv =
typeof global !== "undefined" && typeof global.process !== "undefined";
var handler = isNodeLikeEnv
? require("./lazy-compilation-node")
: require("./lazy-compilation-web");
handler.setUrl(decodeURICo... | fim | webpack/webpack | javascript |
<|fim_suffix|>e;
};
<|fim_prefix|>"use strict";
/* global __resourceQuery */
if (typeof EventSource !== "function") {
throw new Error(
"Environment doesn't support lazy compilation (requires EventSource)"
);
}
var urlBase = decodeURIComponent(__resourceQuery.slice(1));
/** @type {EventSource | undefined} */
var ... | fim | webpack/webpack | javascript |
<|fim_prefix|>/**
* @param {boolean} is<|fim_suffix|>ps")>}
*/
module.exports = function (isHTTPS) {
return isHTTPS ? import("https") : import("http");
};
<|fim_middle|>HTTPS true when need https module, otherwise false
* @returns {Promise<import("http") | import("htt<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>);
if (numberIds)
log(
"info",
'[HMR] Consider using the optimization.moduleIds: "named" for module names.'
);
}
};
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
/**
* @param {(string | number)[]} updatedModules updated... | fim | webpack/webpack | javascript |
<|fim_prefix|>/** @typedef {"info" | "warning" | "error"} LogLevel */
/** @type {LogLevel} */
var logLevel = "info";
function dummy() {}
/**
* @param {LogLevel} level log level
* @returns {boolean} true, if should log
*/
function shouldLog(level) {
var shouldLog =
(logLevel === "info" && level === "info") ||
... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
/* g<|fim_suffix|>Unaccepted: true,
ignoreDeclined: true,
ignoreErrored: true,
onUnaccepted: function (data) {
log(
"warning",
"Ignored an update to unaccepted modul... | fim | webpack/webpack | javascript |
<|fim_suffix|>) >= 0) {
log("warning", "[HMR] Cannot apply update.");
log("warning", "[HMR] " + log.formatError(err));
log("warning", "[HMR] You need to restart the application!");
} else {
log("warning", "[HMR] Update failed: " + log.formatError(err));
}
});
}
};
setInterval(c... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
/* globals __resourceQuery */
if (module.hot) {
var log = require("./log");
/**
* @param {boolean=} fromUpdate true when called from update
*/
var checkForUpdate = function checkForUpdate(fromUpdate... | fim | webpack/webpack | javascript |
<|fim_suffix|>formIgnorePatterns: ["<rootDir>"],
coverageDirectory: "<rootDir>/coverage",
coveragePathIgnorePatterns: [
"\\.runtime\\.js$",
"<rootDir>/test",
"<rootDir>/schemas",
"<rootDir>/examples",
"<rootDir>/node_modules"
],
testEnvironment: "./test/harness/patch-node-env.js",
snapshotResolver: "./te... | fim | webpack/webpack | javascript |
<|fim_suffix|>ntext__: {
expr: RuntimeGlobals.systemContext,
req: [RuntimeGlobals.systemContext],
type: "object",
assign: false
},
__webpack_share_scopes__: {
expr: RuntimeGlobals.shareScopeMap,
req: [RuntimeGlobals.shareScopeMap],
type: "object",
assign: false
},
__webpack_init_sharing_... | fim | webpack/webpack | javascript |
<|fim_suffix|>erialize(context) {
const { read } = context;
this.groupOptions = read();
this.loc = read();
this.request = read();
super.deserialize(context);
}
}
makeSerializable(AsyncDependenciesBlock, "webpack/lib/AsyncDependenciesBlock");
Object.defineProperty(AsyncDependenciesBlock.prototype, "module",... | fim | webpack/webpack | javascript |
<|fim_suffix|> remember previously built normal modules and enqueue
* them as `PrefetchDependency` requests during the next make phase.
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
compiler.hooks.compilation.tap(
PLUGIN_NAME,
(compilation, { normalModuleFact... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { ConcatSource } = require("webpack-sources");
const Compilation = require("./Compilation");
const ModuleFilenameHelpers = require("./ModuleFilenameHelpers");
const Template =<|fim_suf... | fim | webpack/webpack | javascript |
<|fim_suffix|>lt === null) {
result = undefined;
}
if (gotHandlers.length > 1) {
const innerCallback = needCalls(gotHandlers.length, () =>
callback(null, result)
);
for (const gotHandler of gotHandlers) {
gotHandler(result, innerCallback);
}
} else if (gotHandlers.length === 1) {
... | fim | webpack/webpack | javascript |
<|fim_suffix|>s.MultiItemCache = MultiItemCache;
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { forEachBail } = require("enhanced-resolve");
const asyncLib = require("neo-async");
const getLazyHashedEtag = require("./cache/getLaz... | fim | webpack/webpack | javascript |
<|fim_suffix|> lastEntry.chunks.add(chunk);
}
} else {
result.push(
(lastEntry = {
onChunks: group.chunks,
chunks: new Set(childGroup.chunks)
})
);
}
}
return result;
}
/**
* Gets child ids by orders map.
* @param {ChunkGraph} chunkGraph the chunk graph
* @param {b... | fim | webpack/webpack | javascript |
<|fim_suffix|>dule(module) {
let cgm = this._modules.get(module);
if (cgm === undefined) {
cgm = new ChunkGraphModule();
this._modules.set(module, cgm);
}
return cgm;
}
/**
* Get chunk graph chunk.
* @private
* @param {Chunk} chunk the chunk
* @returns {ChunkGraphChunk} internal chunk
*/
_ge... | fim | webpack/webpack | javascript |
<|fim_suffix|>tained this chunk group
*/
getFiles() {
/** @type {Set<string>} */
const files = new Set();
for (const chunk of this.chunks) {
for (const file of chunk.files) {
files.add(file);
}
}
return [...files];
}
/**
* Disconnects this group from its parents, children, and chunks.
* ... | fim | webpack/webpack | javascript |
<|fim_suffix|>ort("./Compilation").ChunkHashContext} ChunkHashContext */
/** @typedef {import("./Compilation").Hash} Hash */
/** @typedef {import("./Compilation").RenderManifestEntry} RenderManifestEntry */
/** @typedef {import("./Compilation").RenderManifestOptions} RenderManifestOptions */
/** @typedef {import("./Com... | fim | webpack/webpack | javascript |
<|fim_suffix|>n.getCompilationHooks(compilation);
const logger = compilation.getLogger(`webpack.${PLUGIN_NAME}`);
const fs = /** @type {OutputFileSystem} */ (compiler.outputFileSystem);
if (!fs.readdir) {
return callback(
new Error(
`${PLUGIN_NAME}: Output filesystem doesn't support listi... | fim | webpack/webpack | javascript |
<|fim_suffix|> @returns {Source} a source
*/
getSource(module, runtime, sourceType) {
return /** @type {Source} */ (
this.get(module, runtime).sources.get(sourceType)
);
}
/**
* Returns the runtime requirements captured during code generation for the
* requested module/runtime pair.
* @param {Module}... | fim | webpack/webpack | javascript |
<|fim_suffix|>atement.range)[0]
}__`;
parser.tagVariable(
statement.id.name,
nestedWebpackIdentifierTag,
{
name: newName,
declaration: {
updated: false,
loc: /** @type {DependencyLocation} */ (statement.id.loc),
range: /** @type {Rang... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const asyncLib = require("neo-async");
const {
AsyncParallelHook,
AsyncSeriesHook,
SyncBailHook,
SyncHook
} = require("tapable");
const { SizeOnlySource } = require("webpack-sources");
c... | fim | webpack/webpack | javascript |
<|fim_suffix|>wExportMap.set(exportName, expression);
}
}
/**
* Records the symbol that should be used for the synthetic namespace export.
* @param {string} symbol identifier of the export in source code
*/
registerNamespaceExport(symbol) {
this._currentModule.namespaceExportSymbol = symbol;
}
/**
* ... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { ConcatSource, PrefixSource } = require("webpack-sources");
const InitFragment = require("./InitFragment");
const Template = require("./Template");
const { mergeRuntime } = require(".... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const {
JAVASCRIPT_MODULE_TYPE_AUTO,
JAVASCRIPT_MODULE_TYPE_DYNAMIC,
JAVASCRIPT_MODULE_TYPE_ESM
} = require("./ModuleTypeConstants");
const CachedConstDependency = require("./dependencies... | fim | webpack/webpack | javascript |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
/** @typedef {import("./Compiler")} Compiler */
const PLUGIN_NAME = "ContextExclusionPlugin";
class ContextExclusionPlugin {
/**
* Creates an instance of ContextExclusionPlugin.
* @param {RegExp} negativeMatcher Matcher regular... | fim | webpack/webpack | javascript |
<|fim_suffix|>/
runtimeRequirements: new Set()
});
const map = this.getUserRequestMap(dependencies, chunkGraph);
const fakeMap = this.getFakeMap(dependencies, chunkGraph);
const asyncDepsMap =
ImportPhaseUtils.isDefer(phase) &&
this.getModuleDeferredAsyncDepsMap(dependencies, chunkGraph);
const thenF... | fim | webpack/webpack | javascript |
<|fim_suffix|> return callback(err, {
fileDependencies,
missingDependencies,
contextDependencies
});
}
// Ignored
if (!beforeResolveResult) {
return callback(null, {
fileDependencies,
missingDependencies,
contextDependencies
});
}
const contex... | fim | webpack/webpack | javascript |
<|fim_suffix|>gResource) {
const newResource = Array.isArray(result.resource)
? result.resource
: [result.resource];
for (let i = 0; i < newResource.length; i++) {
if (
!newResource[i].startsWith("/") &&
(newResource[i].length <= 1 || newResource[i][1] !== ":")
... | fim | webpack/webpack | javascript |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { SyncWaterfallHook } = require("tapable");
const {
JAVASCRIPT_MODULE_TYPE_AUTO,
JAVASCRIPT_MODULE_TYPE_DYNAMIC,
JAVASCRIPT_MODULE_TYPE_ESM
} = require("./ModuleTypeConstants");
const RuntimeGlob... | fim | webpack/webpack | javascript |
<|fim_suffix|>dencies = read();
this.blocks = read();
for (const block of this.blocks) {
block.parent = this;
}
}
}
makeSerializable(DependenciesBlock, "webpack/lib/DependenciesBlock");
module.exports = DependenciesBlock;
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Auth... | fim | webpack/webpack | javascript |
<|fim_suffix|>ction") {
return dependency.canConcatenate();
}
return false;
};
// TODO remove in webpack 6
Object.defineProperty(Dependency.prototype, "disconnect", {
/**
* Returns throws.
* @deprecated
* @returns {EXPECTED_ANY} throws
*/
get() {
throw new Error(
"disconnect was removed from Depende... | fim | webpack/webpack | javascript |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */
/** @typedef {import("./ChunkGraph")} ChunkGraph */
/** @typedef {import("./CodeGenerationResults")} CodeGenerationResults */
/** @t... | fim | webpack/webpack | javascript |
<|fim_suffix|>nction);
newInstance._map = new Map(this._map);
newInstance._hash = this._hash;
return newInstance;
}
}
module.exports = DependencyTemplates;
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { DEFAULTS } = requi... | fim | webpack/webpack | javascript |
<|fim_suffix|>const envFiles = this._getEnvFilesForMode(fs, dir, mode);
// Read all files
const contents = await Promise.all(
envFiles.map((filePath) =>
this._loadFile(fs, filePath).then(
(content) => {
fileDependencies.push(filePath);
return content;
},
() => {
// File does... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Auth<|fim_suffix|>esc.import
)) {
promises.push(
new Promise(
/**
* Handles the callback logic for this hook.
* @param {(value?: undefined) => void} resolve resolve
* @param {(re... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/** @typedef {import("../declarations/WebpackOptions").EntryDescriptionNormalized} EntryDescription */
/** @typedef {import("../declarations/WebpackOptions").EntryNormalized} Entry */
/** @t... | fim | webpack/webpack | javascript |
<|fim_suffix|>rce.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const EntryDependency = require("./dependencies/EntryDependency");
/** @typedef {import("./Compiler")} Compiler */
/** @typedef {import("./Entrypoint").EntryOptions} EntryOptions */
const PLUGIN_NAME = "EntryPlugin";
clas... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ChunkGroup = require("./ChunkGroup");
const SortableSet = require("./util/SortableSet");
/** @typedef {import("../declarations/WebpackOptions").EntryDescriptionNormalized} EntryDescri... | fim | webpack/webpack | javascript |
<|fim_suffix|> definitions[`process.env.${key}`] = defValue;
definitions[`import.meta.env.${key}`] = defValue;
}
definePlugin.definitions = definitions;
});
definePlugin.apply(compiler);
}
}
module.exports = EnvironmentPlugin;
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-licens... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const loaderFlag = "LOADER_EXECUTION";
const webpackOptionsFlag = "WEBPACK_OPTIONS";
/**
* Returns stack trace without the specified flag included.
* @param {string} stack stack tr<|fim_... | fim | webpack/webpack | javascript |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { ConcatSource, RawSource } = require("webpack-sources");
const ExternalModule = require("./ExternalModule");
const ModuleFilenameHelpers = require("./ModuleFilenameHelpers");
const RuntimeGlobals =... | fim | webpack/webpack | javascript |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { ConcatSource, RawSource } = require("webpack-sources");
const ModuleFilenameHelpers = require("./ModuleFilenameHelpers");
const NormalModule = require("./NormalModule");
const RuntimeGlobals = req... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { ImportPhaseUtils } = require("./dependencies/ImportPhase");
const { InlinedUsedName } = require("./optimize/InlineExports");
const { equals } = require("./util/ArrayHelpers");
const ... | fim | webpack/webpack | javascript |
<|fim_suffix|> members[members.length - 1]
)
: new ExportsInfoDependency(
/** @type {Range} */ (expr.range),
null,
members[0]
);
dep.loc = /** @type {DependencyLocation} */ (expr.loc);
parser.state.module.addDependency(dep);
re... | fim | webpack/webpack | javascript |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { SyncBailHook } = require("tapable");
const { OriginalSource, RawSource } = require("webpack-sources");
const ConcatenationScope = require("./ConcatenationScope");
const { UsageState } = require(".... | fim | webpack/webpack | javascript |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const util = require("util");
const ExternalModule = require("./ExternalModule");
const { ASSET_URL_TYPE } = require("./ModuleSourceTypeConstants");
const ContextElementDependency = require("./dependencie... | fim | webpack/webpack | javascript |
<|fim_suffix|>pe {Imported} */
(
imported.map(([specifier, finalName]) => [
specifier,
rawExportMap.has(specifier)
? rawExportMap.get(specifier)
: finalName
])
);
fragment.setImported(newImported);
initFragmentChanged = true;
}
}
... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { getEntry<|fim_suffix|> /** @type {FactoryMeta} */
(module.factoryMeta).sideEffectFree = false;
}
});
});
}
}
module.exports = FlagAllModulesAsUsedPlugin;
<|fim_middle... | fim | webpack/webpack | javascript |
<|fim_suffix|>storedFromCache +
statNotCached +
statFlaggedUncached +
statNoExports)
)}% of exports of modules have been determined (${statNoExports} no declared exports, ${statNotCached} not cached, ${statFlaggedUncached} flagged uncacheable, ${statRestoredFromCache} from cache... | fim | webpack/webpack | javascript |
<|fim_suffix|>p.set(key, item);
}
// if oldItem is already an array we have to do nothing
// if oldItem is an ReferencedExport object, we don't have to do anything
// as canMangle defaults to true for arrays
} else {
const key = item.name.join("\n");
... | fim | webpack/webpack | javascript |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { getEntryRuntime } = require("./util/runtime");
/** @typedef {import("./Compiler")} Compiler */
const PLUGIN_NAME = "FlagEntryExportAsUsedPlugin";
class FlagEntryExportAsUsedPlugin {
/**
* Cr... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { JAVASCRIPT_TYPE } = require("./ModuleSourceTypeConstants");
/** @typedef {import("webpack-sources").Source} Source */
/** @typedef {import("./ChunkGraph")} ChunkGraph */
/** @typede... | fim | webpack/webpack | javascript |
<|fim_suffix|> r: [...removedChunkIds],
m:
removedModules.size === 0
? completelyRemovedModulesArray
: [
...completelyRemovedModulesArray,
...Array.from(
removedModules,
(m) =>
/** @type {ModuleId} */ (chunkGraph.ge... | fim | webpack/webpack | javascript |
<|fim_suffix|>/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Chunk = require("./Chunk");
class HotUpdateChunk extends Chunk {
constructor() {
super();
}
}
module.exports = HotUpdateChunk;
<|fim_prefix|>/*
MIT <|fim_middle|>License http://www.opensource.org/licenses<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const RawModule = require("./RawModule");
const EntryDependency = require("./dependencies/EntryDependency");
/** @typedef {import("../declarations/plugins/IgnorePlugin").IgnorePluginOptions... | fim | webpack/webpack | javascript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.