2017-11-11 21:51:09 +00:00
|
|
|
/*! webpack.config.js */
|
|
|
|
|
|
|
|
const webpack = require("webpack");
|
2017-11-11 23:21:52 +00:00
|
|
|
const path = require('path');
|
2017-11-11 21:51:09 +00:00
|
|
|
const CleanCSSPlugin = require("less-plugin-clean-css");
|
2017-11-10 07:38:47 +00:00
|
|
|
|
|
|
|
module.exports = {
|
2017-11-11 23:21:52 +00:00
|
|
|
entry: "./client/dcwebui.ts",
|
2017-11-10 07:38:47 +00:00
|
|
|
output: {
|
2017-11-11 23:21:52 +00:00
|
|
|
path: path.resolve(__dirname, 'clientpack'),
|
|
|
|
filename: "bundle.min.js"
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
// Add '.ts' and '.tsx' as a resolvable extension.
|
|
|
|
extensions: [ '.tsx', '.ts', '.js' ]
|
2017-11-10 07:38:47 +00:00
|
|
|
},
|
|
|
|
module: {
|
|
|
|
loaders: [
|
2017-11-11 21:51:09 +00:00
|
|
|
|
2017-11-11 23:21:52 +00:00
|
|
|
// all files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'
|
|
|
|
{ test: /\.tsx?$/, loader: "ts-loader" },
|
|
|
|
|
2017-11-11 21:51:09 +00:00
|
|
|
// Plain CSS files (no longer present)
|
|
|
|
{ test: /\.css$/, loader: "style-loader!css-loader" },
|
|
|
|
|
|
|
|
// LESS CSS files
|
|
|
|
{
|
|
|
|
test: /\.less$/,
|
|
|
|
use: [
|
|
|
|
{ loader: "style-loader" },
|
|
|
|
{ loader: "css-loader" },
|
|
|
|
{
|
|
|
|
loader: "less-loader",
|
|
|
|
options: {
|
|
|
|
noIeCompat: false,
|
|
|
|
plugins: [
|
|
|
|
new CleanCSSPlugin({ advanced: true })
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2017-11-10 07:38:47 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.optimize.UglifyJsPlugin({
|
|
|
|
compress: {
|
|
|
|
warnings: false
|
|
|
|
}
|
|
|
|
})
|
|
|
|
]
|
2017-11-11 21:38:35 +00:00
|
|
|
};
|