Update webpack to v4 (#6366)

* Update webpack to v4

* add todo

* add link
master
fisker Cheung 2019-09-14 05:55:30 +08:00 committed by Lipis
parent e83b4537fe
commit 370e827217
4 changed files with 677 additions and 320 deletions

View File

@ -114,7 +114,7 @@
"snapshot-diff": "0.4.0",
"strip-ansi": "4.0.0",
"tempy": "0.2.1",
"webpack": "3.12.0"
"webpack": "4.39.1"
},
"scripts": {
"prepublishOnly": "echo \"Error: must publish from dist/\" && exit 1",

View File

@ -99,7 +99,7 @@ async function run(params) {
await execa("rm", ["-rf", ".cache"]);
}
const bundleCache = new Cache(".cache/", "v13");
const bundleCache = new Cache(".cache/", "v14");
await bundleCache.load();
console.log(chalk.inverse(" Building packages "));

View File

@ -176,13 +176,16 @@ function getWebpackConfig(bundle) {
path: path.resolve(root, "dist"),
filename: bundle.output,
library: ["prettierPlugins", bundle.name],
libraryTarget: "umd"
libraryTarget: "umd",
// https://github.com/webpack/webpack/issues/6642
globalObject: 'new Function("return this")()'
},
plugins: [
new webpack.DefinePlugin({
"process.env.NODE_ENV": JSON.stringify("production")
})
]
optimization: {
// TODO: enable this
// `parser-postcss.js` can't work with terser
// https://github.com/prettier/prettier/pull/6200#issuecomment-500018106
minimize: false
}
};
}

978
yarn.lock

File diff suppressed because it is too large Load Diff