nmdc-webfrontend/webpack.config.js

54 lines
1.2 KiB
JavaScript
Raw Normal View History

/*! webpack.config.js */
const webpack = require("webpack");
2017-11-11 23:21:52 +00:00
const path = require('path');
const CleanCSSPlugin = require("less-plugin-clean-css");
module.exports = {
2017-11-11 23:21:52 +00:00
entry: "./client/dcwebui.ts",
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' ]
},
module: {
loaders: [
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" },
// 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 })
]
}
}
]
}
]
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})
]
};