mirror of https://github.com/webpack/webpack.git
Merge 6382a6653b
into c7ebdbda63
This commit is contained in:
commit
5e0829aabd
|
@ -439,6 +439,7 @@ class ContextModule extends Module {
|
|||
defaultObject: "redirect-warn"
|
||||
};
|
||||
this.buildInfo = {
|
||||
strict: true,
|
||||
snapshot: undefined
|
||||
};
|
||||
this.dependencies.length = 0;
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
/** @type {import('fs')} */
|
||||
const fs = __non_webpack_require__("fs");
|
||||
|
||||
it("should import", async () => {
|
||||
const n = "a.js";
|
||||
const { default: a1 } = await import(`./sub/${n}`);
|
||||
expect(a1).toBe("a");
|
||||
});
|
||||
|
||||
it("should startsWith use strict", async () => {
|
||||
const source = fs.readFileSync(__filename, "utf-8");
|
||||
expect(source.length).not.toBe(0);
|
||||
expect(source.startsWith('/******/ "use strict"')).toBeTruthy();
|
||||
});
|
||||
|
||||
it("should have all strict modules", () => {
|
||||
const source = fs.readFileSync(__filename, "utf-8");
|
||||
expect(source.length).not.toBe(0);
|
||||
|
||||
expect(source).not.toContain(
|
||||
[
|
||||
"This",
|
||||
"entry",
|
||||
"needs",
|
||||
"to",
|
||||
"be",
|
||||
"wrapped",
|
||||
"in",
|
||||
"an",
|
||||
"IIFE",
|
||||
"because",
|
||||
"it",
|
||||
"needs",
|
||||
"to",
|
||||
"be",
|
||||
"in",
|
||||
"strict",
|
||||
"mode."
|
||||
].join(" ")
|
||||
);
|
||||
});
|
|
@ -0,0 +1,7 @@
|
|||
module.exports = options => {
|
||||
if (options.cache && options.cache.type === "filesystem") {
|
||||
return [/Pack got invalid because of write to/];
|
||||
}
|
||||
|
||||
return [];
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
export default "a"
|
|
@ -0,0 +1,6 @@
|
|||
/** @type {import("../../../../").Configuration} */
|
||||
module.exports = {
|
||||
entry: "./index.mjs",
|
||||
output: { iife: false },
|
||||
optimization: { concatenateModules: true }
|
||||
};
|
Loading…
Reference in New Issue