andywer / andywer/webpack-blocks

Cannot see how to remove or filter out HotModuleReplacementPlugin

未关闭
#314 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
3k
派生
91
PR 合并指标
30 天内没有已合并 PR

描述

Even when running `webpack -p --mode production` I am getting all the Hot code in my produced Javascript. No configuration options seem to exist to exclude it. Here is my config file for reference:

```
const {
createConfig,
entryPoint,
resolve,
setOutput,
match,
typescript,
css,
file,
addPlugins,
env,
devServer
} = require('webpack-blocks');

const {
CleanWebpackPlugin
} = require('clean-webpack-plugin');
const WasmPackPlugin = require('@wasm-tool/wasm-pack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlBeautifyPlugin = require('html-beautify-webpack-plugin');

const path = require('path');
const distPath = path.resolve(__dirname, "target/deploy");

module.exports = createConfig([
entryPoint(['./bootstrap.js', './src/runtime.ts']),
resolve({
extensions: ['.wasm']
}),
setOutput({
path: distPath,
filename: 'coolcats-ui.js',
webassemblyModuleFilename: 'coolcats-ui.wasm'
}),
typescript(),
css({
options: {
styleLoader: true
}
}),
match(['*.png', '*.jpg', '*.gif'], [
file({
name: '[name].[ext]',
})
]),
addPlugins([
new CleanWebpackPlugin({
verbose: true,
cleanOnceBeforeBuildPatterns: [distPath],
}),
new WasmPackPlugin({
crateDirectory: ".",
extraArgs: "--no-typescript",
}),
new HtmlWebpackPlugin({
inject: false,
template: require('html-webpack-template'),
filename: 'index.html',
title: 'coolcats-ui',
meta: [{
name: 'viewport',
content: 'width=device-width, initial-scale=1, shrink-to-fit=no',
}],
links: [{
rel: 'stylesheet',
href: 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css',
integrity: 'sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u',
crossorigin: 'anonymous',
}],
favicon: 'src/application/interfaces/images/favicon.png',
appMountIds: ['holoclient', 'application'],
scripts: ['coolcats-ui.js'],
chunks: [],
}),
new HtmlBeautifyPlugin({
config: {
html: {
indent_size: 2,
end_with_newline: true,
},
},
})
]),
env('development', [
devServer({
contentBase: distPath,
port: 8000
})
])
])
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。