redoc/build/webpack.dev.js

51 lines
1.2 KiB
JavaScript
Raw Normal View History

2016-08-28 21:46:10 +03:00
const webpack = require('webpack');
const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin;
const StringReplacePlugin = require("string-replace-webpack-plugin");
2016-08-28 21:46:10 +03:00
const root = require('./helpers').root;
const VERSION = JSON.stringify(require('../package.json').version);
const IS_PRODUCTION = process.env.NODE_ENV === "production";
2016-08-28 21:46:10 +03:00
const webpackMerge = require('webpack-merge'); // used to merge webpack configs
const commonConfig = require('./webpack.common.js');
module.exports = webpackMerge(commonConfig({
IS_PRODUCTION: IS_PRODUCTION,
AOT: IS_PRODUCTION
}), {
2016-11-01 10:57:06 +03:00
devtool: '#inline-source-map',
2016-08-28 21:46:10 +03:00
entry: {
'polyfills': './lib/polyfills.ts',
'redoc': './lib/index.ts',
2016-08-28 21:46:10 +03:00
},
devServer: {
2016-11-29 10:20:11 +03:00
contentBase: root('demo'),
watchContentBase: true,
compress: true,
2016-08-28 21:46:10 +03:00
watchOptions: {
poll: true
},
port: 9000,
hot: false,
stats: 'errors-only'
2016-08-28 21:46:10 +03:00
},
module: {
rules: [
{
test: /\.ts$/,
use: [
2017-05-08 11:24:25 +03:00
'awesome-typescript-loader',
'angular2-template-loader',
],
exclude: [/\.(spec|e2e)\.ts$/]
},
]
2016-08-28 21:46:10 +03:00
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: ['vendor', 'polyfills'],
minChunks: Infinity
})
]
})