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

Cannot see how to remove or filter out HotModuleReplacementPlugin #314

Open
pythagorean opened this issue Aug 26, 2019 · 0 comments
Open

Comments

@pythagorean
Copy link

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
    })
  ])
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant