Last active
February 6, 2018 06:45
-
-
Save alonstar/5207826de69df256cd82fd60e7b91959 to your computer and use it in GitHub Desktop.
Webpack for ASP.NET CORE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const UglifyJsPlugin = require('uglifyjs-webpack-plugin') | |
const webpack = require('webpack'); | |
//const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
module.exports = { | |
entry: { | |
main: "./Scripts/main.ts", | |
hub: "./Scripts/hub.ts" | |
}, | |
output: { | |
publicPath: "/js/", | |
path: path.join(__dirname, '/wwwroot/js/'), | |
filename: '[name].build.js' | |
}, | |
resolve: { | |
extensions: ['.ts', '.tsx', '.js', '.jsx'] | |
}, | |
devtool: 'source-map', | |
module: { | |
loaders: [ | |
// all files with a '.ts' or '.tsx' extension will be handled by 'ts-loader' | |
{ test: /\.tsx?$/, loader: "awesome-typescript-loader" }, | |
//{ | |
// test: /\.scss$/, | |
// use: extractPlugin.extract({ | |
// use: ['css-loader', 'sass-loader'] | |
// }) | |
//} | |
] | |
}, | |
plugins: [ | |
new webpack.ProvidePlugin({ | |
$: 'jquery', | |
jQuery: 'jquery', | |
'window.jQuery': 'jquery', | |
Popper: ['popper.js', 'default'] | |
}), | |
new UglifyJsPlugin() | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment