Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const config = {
- context: path.join(__dirname, "src"),
- entry: {
- projectSettingsPage: "./app/project/index",
- issuePanel: "./app/issue/index",
- contactDetailsDialog: "./app/dialog/index",
- wpfConversationNotify: "./app/wpf/notify/index",
- },
- output: {
- filename: '[name].js',
- path: path.join(__dirname, "..", "server", "public", "js"),
- publicPath: '/assets/js/',
- devtoolModuleFilenameTemplate: '[absolute-resource-path]'
- },
- resolve: {
- extensions: ['.ts', ".tsx", '.js'],
- },
- module: {
- rules: [
- {
- test: /\.tsx?$/,
- enforce: 'pre',
- use: [
- {loader: 'tslint-loader'},
- ],
- exclude: /(node_modules)/
- },
- {
- test: /\.tsx?$/,
- use: [
- {loader: "awesome-typescript-loader"},
- ],
- exclude: /(node_modules)/
- },
- {
- test: /\.css$/,
- use: [
- {loader: "style-loader"},
- {loader: "css-loader"},
- ],
- },
- {
- test: /\.(jpe?g|png|gif|svg)$/i,
- use: [
- {loader: "file-loader"},
- ],
- },
- ]
- },
- plugins: [
- new WebpackNotifierPlugin({
- alwaysNotify: false
- }),
- new webpack.optimize.CommonsChunkPlugin({
- name: 'vendors',
- filename: 'vendor.js'
- }),
- new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
- new CompressionPlugin(),
- ],
- };
- if (process.env.NODE_ENV === 'production') {
- config.plugins.push(new webpack.DefinePlugin({
- 'process.env': {
- 'NODE_ENV': JSON.stringify('production')
- }
- }));
- config.plugins.push(new UglifyJsPlugin());
- } else {
- config.devtool = 'source-map';
- config.plugins.push(new CheckerPlugin());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement