Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
plugins: (dev
? []
: [
new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output
// both options are optional
filename: "static/css/[name].[contenthash:8].css",
chunkFilename: "static/css/[name].[contenthash:8].chunk.css"
}),
new ManifestPlugin({
fileName: "asset-manifest.json"
})
]
).concat([
new InterpolateHtmlPlugin(HtmlWebpackPlugin, env.raw),
new HtmlWebpackPlugin({
inject: true,
template: paths.catalogIndexHtml,
minify: dev
? false
: {
removeComments: true,
collapseWhitespace: true,
removeRedundantAttributes: true,
useShortDoctype: true,
removeEmptyAttributes: true,
removeStyleLinkTypeAttributes: true,
keepClosingSlash: true,
minifyJS: true,
minifyCSS: true,
minifyURLs: true
resolve: {
modules: [
`${NODE_MODULES}`,
`${SRC}`
],
extensions: ['.js', '.json', '.jsx'],
alias: {
},
},
// add new BundleAnalyzerPlugin() to see webpack output analysis
plugins: [
new InterpolateHtmlPlugin(env.raw),
new webpack.DefinePlugin(env.stringified),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function (module) {
// this assumes your vendor imports exist in the node_modules directory
return module.context && module.context.indexOf('node_modules') !== -1;
}
}),
new webpack.LoaderOptionsPlugin({
minimize: true,
debug: false
}),
new webpack.optimize.UglifyJsPlugin({
beautify: false,
mangle: {
`${SRC}`
],
extensions: ['.js', '.json', '.jsx'],
alias: {
},
},
plugins: [
new DashboardPlugin(),
new webpack.DllReferencePlugin({
manifest: `${NODE_MODULES}/vendor-manifest.json`,
}),
new InterpolateHtmlPlugin(env.raw),
new webpack.DefinePlugin(env.stringified),
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new HtmlWebpackPlugin({
template: `${PUBLIC}/index.html`,
}),
new AddAssetHtmlPlugin({
filepath: `${NODE_MODULES}/vendor.dll.js`,
includeSourcemap: false
}),
new ExtractTextPlugin({
disable: true,
}),
new CircularDependencyPlugin({
exclude: /a\.js|node_modules/, // exclude node_modules
},
{
from: locations.template.serveJson,
to: locations.production.serveJson,
},
{
from: locations.template.favicon,
to: locations.production.favicon,
},
]),
// Generate the `index.html`
new ExpoHtmlWebpackPlugin(env),
// Add variables to the `index.html`
new InterpolateHtmlPlugin(ExpoHtmlWebpackPlugin, {
WEB_PUBLIC_URL: publicPath,
WEB_TITLE: config.web.name,
NO_SCRIPT: noJSComponent,
LANG_ISO_CODE: lang,
ROOT_ID: rootId,
}),
new WebpackPWAManifestPlugin(config, {
publicPath,
noResources: isDev || !env.pwa,
filename: locations.production.manifest,
HtmlWebpackPlugin: ExpoHtmlWebpackPlugin,
}),
// This gives some necessary context to module not found errors, such as
// the requesting resource.
devtool: 'cheap-module-source-map',
entry: {
manager: [require.resolve('./polyfills'), managerPath],
preview: [
require.resolve('./polyfills'),
require.resolve('./globals'),
`${require.resolve('webpack-hot-middleware/client')}?reload=true`,
],
},
output: {
path: path.join(__dirname, 'dist'),
filename: 'static/[name].bundle.js',
publicPath: '/',
},
plugins: [
new InterpolateHtmlPlugin(process.env),
new HtmlWebpackPlugin({
filename: 'index.html',
chunks: ['manager'],
data: {
managerHead: getManagerHeadHtml(configDir),
version,
},
template: require.resolve('../index.html.ejs'),
}),
new HtmlWebpackPlugin({
filename: 'iframe.html',
excludeChunks: ['manager'],
data: {
previewHead: getPreviewHeadHtml(configDir),
},
template: require.resolve('../iframe.html.ejs'),
devtool: 'cheap-module-source-map',
entry: {
manager: [require.resolve('./polyfills'), managerPath],
preview: [
require.resolve('./polyfills'),
require.resolve('./globals'),
`${require.resolve('webpack-hot-middleware/client')}?reload=true`,
],
},
output: {
path: path.join(__dirname, 'dist'),
filename: 'static/[name].bundle.js',
publicPath: '/',
},
plugins: [
new InterpolateHtmlPlugin(process.env),
new HtmlWebpackPlugin({
filename: 'index.html',
chunks: ['manager'],
data: {
managerHead: getManagerHeadHtml(configDir),
version,
},
template: require.resolve('../index.html.ejs'),
}),
new HtmlWebpackPlugin({
filename: 'iframe.html',
excludeChunks: ['manager'],
data: {
previewHead: getPreviewHeadHtml(configDir),
},
template: require.resolve('../iframe.html.ejs'),
devtool: 'cheap-module-source-map',
entry: {
manager: [require.resolve('./polyfills'), managerPath],
preview: [
require.resolve('./polyfills'),
require.resolve('./globals'),
`${require.resolve('webpack-hot-middleware/client')}?reload=true`,
],
},
output: {
path: path.join(__dirname, 'dist'),
filename: 'static/[name].bundle.js',
publicPath: '/',
},
plugins: [
new InterpolateHtmlPlugin(process.env),
new HtmlWebpackPlugin({
filename: 'index.html',
chunks: ['manager'],
data: {
managerHead: getManagerHeadHtml(configDir),
version,
},
template: require.resolve('../index.html.ejs'),
}),
new HtmlWebpackPlugin({
filename: 'iframe.html',
excludeChunks: ['manager'],
data: {
previewHead: getPreviewHeadHtml(configDir),
},
template: require.resolve('../iframe.html.ejs'),