How to use npm-install-webpack-plugin - 2 common examples

To help you get started, we’ve selected a few npm-install-webpack-plugin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github d4rkr00t / aik / src / lib / webpack-config-prod.js View on Github external
export function setupPlugins(template) {
  const htmlPluginOptions = {
    title: last(process.cwd().split(path.sep))
  };

  if (template) {
    htmlPluginOptions.template = template;
  }

  return [
    new HtmlWebpackPlugin(htmlPluginOptions),
    new NpmInstallPlugin({
      save: false,
      saveDev: false,
      saveExact: false
    }),
    new webpack.DefinePlugin({ 'process.env.NODE_ENV': '"production"' }),
    new webpack.optimize.OccurrenceOrderPlugin(),
    new webpack.optimize.DedupePlugin(),
    new webpack.optimize.UglifyJsPlugin({
      compressor: {
        screw_ie8: true,
        warnings: false
      },
      mangle: {
        screw_ie8: true
      },
      output: {
github CSSSR / csssr-project-template / webpack.conf.js View on Github external
}].filter(loader => loader)
		},
		plugins: [
			new HappyPack({
				loaders: ['babel'],
				threads: 4,
				verbose: false,
				cache: true
			}),
			new webpack.DefinePlugin({
				'process.env': {
					NODE_ENV: JSON.stringify(process.env.NODE_ENV)
				}
			})
		].concat(debug ? [
			new NpmInstallPlugin({saveDev: true}),
			new webpack.HotModuleReplacementPlugin()
		] : [
			new webpack.optimize.DedupePlugin(),
			new webpack.optimize.UglifyJsPlugin({compress: {warnings: false}, output: {comments: false}})
		]),
		eslint: {
			configFile: path.join(__dirname, '.eslintrc'),
			emitErrors: false,
			emitWarning: true,
			formatter: eslintFormatter({notify})
		}
	};
}

npm-install-webpack-plugin

Webpack loader to automatically npm install & save dependencies.

MIT
Latest version published 7 years ago

Package Health Score

47 / 100
Full package analysis

Popular npm-install-webpack-plugin functions