Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
);
let API_URL;
// Configure demo mode
if (process.env.PUBLISH_ENV === 'github') {
API_URL = '/SBideo/items-demo.json';
config.output.publicPath = '/SBideo/';
fileManagerPluginOptions.onStart.copy.push({
source: './data-clientdemo',
destination: env.dest
});
}
config.plugins.push(new FileManagerPlugin(fileManagerPluginOptions));
config.plugins.push(
new helpers.webpack.DefinePlugin({
'process.env.API_URL': JSON.stringify(API_URL || '/items.json'),
'process.env.ASSET_PATH': JSON.stringify(
(config.output.publicPath || '/') + 'assets/'
)
})
);
};
: [],
)
.concat(withAnalyze ? new BundleAnalyzerPlugin() : [])
.concat(withHot && type !== 'prod' ? new webpack.HotModuleReplacementPlugin() : [])
.concat(
forGHPages
? new HtmlWebpackPlugin({
filename: '404.html',
template: 'assets/index.html',
chunksSortMode: sortChunks,
})
: [],
)
.concat(
forGHPages
? new FileManagerWebpackPlugin({
onEnd: {
copy: [
{
source: `src/assets/ghPages/**`,
destination: `build`,
},
],
},
})
: [],
);