angular-gantt
Version:
Gantt chart component for AngularJS
49 lines (45 loc) • 1.68 kB
JavaScript
var path = require('path')
var utils = require('./utils')
var webpack = require('webpack')
var config = require('../config')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
module.exports = merge(baseWebpackConfig, {
entry: {
// add hot-reload related code to entry chunks
'angular-gantt-demo': ['./build/dev-client', './demo/index.ts']
},
module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap })
},
// cheap-module-eval-source-map is faster for development, but it seems to not work properly here
//devtool: '#inline-source-map',
plugins: [
new webpack.DefinePlugin({
'process.env': config.dev.env
}),
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'demo/index.html',
inject: true
}),
new FriendlyErrorsPlugin(),
// devtool option doesn't output typescript sourcemaps to karma
new webpack.SourceMapDevToolPlugin({
filename: null, // if no value is provided the sourcemap is inlined
test: /\.(ts|js|html)($|\?)/i // process .js and .ts files only
})
]
})
if (config.dev.hotModuleReload) {
// TODO: Implement angular-hot-loader (https://github.com/vitaliy-bobrov/angular-hot-loader)
}