- Upgrades webpack and webpack-dev-server for bugfixes and performance updates - Removes unnecessary file watching - Enables persistent build cache in dev - Switches to faster dev source map
44 lines
1.0 KiB
JavaScript
44 lines
1.0 KiB
JavaScript
const path = require("path");
|
|
const { merge } = require("webpack-merge");
|
|
|
|
const [main, vnc] = require("./webpack.config.js");
|
|
const devServerConfig = require("./config/dev-server.js");
|
|
|
|
const shoelaceAssetsSrcPath = path.resolve(
|
|
__dirname,
|
|
"node_modules/@shoelace-style/shoelace/dist/assets"
|
|
);
|
|
const shoelaceAssetsPublicPath = "shoelace/assets";
|
|
|
|
module.exports = [
|
|
merge(main, {
|
|
devtool: "eval-cheap-source-map",
|
|
devServer: {
|
|
watchFiles: ["src/**/*", __filename],
|
|
open: true,
|
|
compress: true,
|
|
static: [
|
|
{
|
|
directory: shoelaceAssetsSrcPath,
|
|
publicPath: "/" + shoelaceAssetsPublicPath,
|
|
},
|
|
],
|
|
historyApiFallback: true,
|
|
proxy: devServerConfig.proxy,
|
|
onBeforeSetupMiddleware: devServerConfig.onBeforeSetupMiddleware,
|
|
port: 9870,
|
|
},
|
|
cache: {
|
|
type: "filesystem",
|
|
hashAlgorithm: "xxhash64",
|
|
buildDependencies: {
|
|
config: [__filename],
|
|
},
|
|
},
|
|
}),
|
|
{
|
|
...vnc,
|
|
mode: "production",
|
|
},
|
|
];
|