const DefinePlugin = require('webpack/lib/DefinePlugin')
const NamedModulesPlugin = require('webpack/lib/NamedModulesPlugin')
const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin')
+const HotModuleReplacementPlugin = require('webpack/lib/HotModuleReplacementPlugin')
/**
* Webpack Constants
const ENV = process.env.ENV = process.env.NODE_ENV = 'development'
const HOST = process.env.HOST || 'localhost'
const PORT = process.env.PORT || 3000
+const PUBLIC = process.env.PUBLIC_DEV || HOST + ':' + PORT
+const AOT = process.env.BUILD_AOT || helpers.hasNpmFlag('aot')
const HMR = helpers.hasProcessFlag('hot')
-const METADATA = webpackMerge(commonConfig({env: ENV}).metadata, {
+const METADATA = {
host: HOST,
port: PORT,
+ public: PUBLIC,
ENV: ENV,
HMR: HMR,
+ AOT: AOT,
API_URL: 'http://localhost:9000'
-})
+}
const DllBundlesPlugin = require('webpack-dll-bundles-plugin').DllBundlesPlugin
libraryTarget: 'var'
},
- module: {
-
- // Too slow, life is short
- // rules: [
- // {
- // test: /\.ts$/,
- // use: [
- // {
- // loader: 'tslint-loader',
- // options: {
- // configFile: 'tslint.json'
- // }
- // }
- // ],
- // exclude: [
- // /\.(spec|e2e)\.ts$/,
- // /node_modules\//
- // ]
- // }
- // ]
- },
-
plugins: [
/**
'HMR': METADATA.HMR,
'API_URL': JSON.stringify(METADATA.API_URL),
'process.version': JSON.stringify(process.version),
- 'process.env': {
- 'ENV': JSON.stringify(METADATA.ENV),
- 'NODE_ENV': JSON.stringify(METADATA.ENV),
- 'HMR': METADATA.HMR
- }
+ 'process.env.ENV': JSON.stringify(METADATA.ENV),
+ 'process.env.NODE_ENV': JSON.stringify(METADATA.ENV),
+ 'process.env.HMR': METADATA.HMR
}),
new DllBundlesPlugin({
}
}
- })
+ }),
+ new HotModuleReplacementPlugin()
],
/**
port: METADATA.port,
host: METADATA.host,
historyApiFallback: true,
+ hot: METADATA.HMR,
watchOptions: {
ignored: /node_modules/
}