Created
April 14, 2017 20:05
-
-
Save giordanocardillo/61c0cf7894f0b75c97b51936eb33cc33 to your computer and use it in GitHub Desktop.
Webpack Express conf
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 webpack = require('webpack'); | |
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
module.exports = { | |
context: path.resolve(__dirname, 'client'), | |
entry: './entry.js', | |
output: { | |
filename: 'bundle.js', | |
path: path.resolve(__dirname, 'public/javascripts'), | |
}, | |
resolve: { | |
extensions: ['.js', '.scss'], | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /\.js$/, | |
exclude: /(node_modules|public)/, | |
loader: 'babel-loader', | |
query: { | |
presets: ['es2015'], | |
}, | |
}, | |
{ | |
test: /\.s?css$/, | |
exclude: /(node_modules|public)/, | |
loader: ExtractTextPlugin.extract({ | |
fallback: 'style-loader', | |
use: ['css-loader?sourceMap', 'sass-loader?sourceMap'], | |
}), | |
}, | |
], | |
}, | |
plugins: [ | |
// new webpack.optimize.UglifyJsPlugin(), | |
new ExtractTextPlugin('../stylesheets/bundle.css'), | |
new webpack.ProvidePlugin({ | |
$: 'jquery', | |
jQuery: 'jquery', | |
adapter: 'webrtc-adapter', | |
Janus: 'node-janus-webrtc', | |
}), | |
], | |
devtool: 'source-map', | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment