const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin')
const OptimizeJsPlugin = require('optimize-js-plugin')
const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin')
-const WebpackMd5Hash = require('webpack-md5-hash')
+const HashedModuleIdsPlugin = require('webpack/lib/HashedModuleIdsPlugin')
/**
* Webpack Constants
host: HOST,
port: PORT,
ENV: ENV,
- HMR: false
+ HMR: false,
+ API_URL: ''
})
module.exports = function (env) {
*
* See: http://webpack.github.io/docs/configuration.html#output-sourcemapfilename
*/
- sourceMapFilename: '[name].[chunkhash].bundle.map',
+ sourceMapFilename: '[file].map',
/**
* The filename of non-entry chunks as relative path
*
* See: http://webpack.github.io/docs/configuration.html#output-chunkfilename
*/
- chunkFilename: '[id].[chunkhash].chunk.js',
+ chunkFilename: '[name].[chunkhash].chunk.js',
publicPath: '/client/'
},
- externals: {
- webtorrent: 'WebTorrent'
- },
-
/**
* Add additional plugins to the compiler.
*
*/
plugins: [
- /**
- * Plugin: WebpackMd5Hash
- * Description: Plugin to replace a standard webpack chunkhash with md5.
- *
- * See: https://www.npmjs.com/package/webpack-md5-hash
- */
- new WebpackMd5Hash(),
-
/**
* Webpack plugin to optimize a JavaScript file for faster initial load
* by wrapping eagerly-invoked functions.
new DefinePlugin({
'ENV': JSON.stringify(METADATA.ENV),
'HMR': METADATA.HMR,
+ 'API_URL': JSON.stringify(METADATA.API_URL),
'process.env': {
'ENV': JSON.stringify(METADATA.ENV),
'NODE_ENV': JSON.stringify(METADATA.ENV),
helpers.root('config/empty.js')
),
- // AoT
- // new NormalModuleReplacementPlugin(
- // /@angular(\\|\/)upgrade/,
- // helpers.root('config/empty.js')
- // ),
- // new NormalModuleReplacementPlugin(
- // /@angular(\\|\/)compiler/,
- // helpers.root('config/empty.js')
- // ),
- // new NormalModuleReplacementPlugin(
- // /@angular(\\|\/)platform-browser-dynamic/,
- // helpers.root('config/empty.js')
- // ),
- // new NormalModuleReplacementPlugin(
- // /dom(\\|\/)debug(\\|\/)ng_probe/,
- // helpers.root('config/empty.js')
- // ),
- // new NormalModuleReplacementPlugin(
- // /dom(\\|\/)debug(\\|\/)by/,
- // helpers.root('config/empty.js')
- // ),
- // new NormalModuleReplacementPlugin(
- // /src(\\|\/)debug(\\|\/)debug_node/,
- // helpers.root('config/empty.js')
- // ),
- // new NormalModuleReplacementPlugin(
- // /src(\\|\/)debug(\\|\/)debug_renderer/,
- // helpers.root('config/empty.js')
- // ),
+ new HashedModuleIdsPlugin(),
/**
* Plugin: IgnorePlugin
* See: https://gist.github.com/sokra/27b24881210b56bbaff7
*/
new LoaderOptionsPlugin({
+ minimize: true,
debug: false,
options: {
node: {
global: true,
crypto: 'empty',
+ fs: 'empty',
process: false,
module: false,
clearImmediate: false,