Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Work toward Webpack 5 with Svue #89

Closed
wants to merge 11 commits into from
Prev Previous commit
Next Next commit
working with Hotmodulereloading off and other tweaks
  • Loading branch information
thadk committed Feb 22, 2022
commit 0fa3f636a5c1afc570ba8dfaf3e707444eef1276
223 changes: 117 additions & 106 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"autoprefixer": "^9.8.0",
"babel-jest": "^27.5.1",
"case-sensitive-paths-webpack-plugin": "^2.4.0",
"circular-dependency-plugin": "^5.2.0",
"circular-dependency-plugin": "^5.2.2",
"concurrently": "^5.3.0",
"cross-env": "^5.2.1",
"cross-env": "^7.0.3",
"css-loader": "^6.6.0",
"dotenv-flow-webpack": "^1.1.0",
"dotenv-webpack":"7.1.0",
Expand Down
18 changes: 13 additions & 5 deletions webpack.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function wrap(spec) {
return spec;
} else {
spec.optimization = {
mangleExports: false,
minimize: false
}
}
Expand All @@ -52,7 +53,14 @@ function wrap(spec) {
console.warn("DocumentCloud: DUMPING ALL ENVIRONMENT VARS INTO FRONTEND")
dotenv.config();

module.exports = wrap({
module.exports = {
optimization: {
mangleExports: false,
minimize: false,
mergeDuplicateChunks: false,
removeEmptyChunks: false,
concatenateModules: false,
},
resolve: { /* https://webpack.js.org/configuration/resolve/#resolvefallback */
alias: {
svelte: path.resolve("node_modules", "svelte"),
Expand All @@ -69,7 +77,7 @@ module.exports = wrap({
loader: "svelte-loader",
options: {
emitCss: prod,
hotReload: !prod,
hotReload: prod,
preprocess: autoPreprocess(preprocessOptions),
},
},
Expand All @@ -80,7 +88,7 @@ module.exports = wrap({
use: [
{
loader: MiniCssExtractPlugin.loader,
options: { hmr: !prod },
options: { hmr: prod },
},
"css-loader",
"sass-loader",
Expand All @@ -91,7 +99,7 @@ module.exports = wrap({
use: [
{
loader: MiniCssExtractPlugin.loader,
options: { hmr: !prod },
options: { hmr: prod },
},
"css-loader",
],
Expand Down Expand Up @@ -173,4 +181,4 @@ module.exports = wrap({
: [])
],
devtool: prod ? false : "source-map",
});
};