redoc/build/webpack.dev.js

52 lines
1.3 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: process.env.NODE_ENV === "production",
AOT: false
}), {
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',
2016-08-28 21:46:10 +03:00
'vendor': './lib/vendor.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: [
'awesome-typescript-loader?{configFileName: "tsconfig.webpack.json"}',
'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
})
]
})