Skip to content

Instantly share code, notes, and snippets.

@giordanocardillo
Created April 14, 2017 20:05
Show Gist options
  • Save giordanocardillo/61c0cf7894f0b75c97b51936eb33cc33 to your computer and use it in GitHub Desktop.
Save giordanocardillo/61c0cf7894f0b75c97b51936eb33cc33 to your computer and use it in GitHub Desktop.
Webpack Express conf
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