Skip to content

Instantly share code, notes, and snippets.

@oxpa
Created August 9, 2016 13:48
Show Gist options
  • Save oxpa/393b6d23b57f021db0dd7625f022aebf to your computer and use it in GitHub Desktop.
Save oxpa/393b6d23b57f021db0dd7625f022aebf to your computer and use it in GitHub Desktop.
module.exports = {
//node: {process:false},
entry: {bundle:['./index.js'], main:['./main.js']},
output: {
path: __dirname +'/compiled/',
filename: '[name].js',
libraryTarget: 'umd'
},
externals: { "react": "React", "redux": "Redux", "react-dom":"ReactDom", "react-redux":"ReactRedux", "react-router":"ReactRouter"},// "flickity":"Flickity"},
module: {
loaders: [
{
test: /\.p?css$/,
loader: ["style-loader", "css-loader", "postcss-loader"]
},
{
test: /.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['react', 'stage-2','es2015-native-modules'],
plugins: ["transform-object-rest-spread","transform-object-assign"]
}
}
]
},
resolve: {
extensions: ["", ".js", "jsx", "js6"],
alias: { /*need these for flickity*/
'eventEmitter/EventEmitter': 'wolfy87-eventemitter/EventEmitter',
'get-style-property': 'desandro-get-style-property',
'matches-selector': 'desandro-matches-selector',
'classie': 'desandro-classie'
}
},
plugins: [
new StaticSiteGeneratorPlugin('main', locals.paths, locals,locals.scope),
//new ExtractTextPlugin('style.css')
]
postcss: function () {
return [precss, autoprefixer];
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment