Created
January 31, 2017 21:16
-
-
Save coliveravenegas/1c21a6cde5edc673557e7c066ee6e89f to your computer and use it in GitHub Desktop.
This file contains 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
var ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
var path = require('path'); | |
const common = { | |
entry: { | |
//JavascriptFiles | |
"bundles": "./crehana/frontdev/jsx/bundles.js", | |
"bundle-detail": "./crehana/frontdev/jsx/bundle-detail.js", | |
"catalog": "./crehana/frontdev/jsx/catalog.js", | |
"homepage": "./crehana/frontdev/jsx/homepage.js", | |
"resource-detail": "./crehana/frontdev/jsx/resource-detail.js", | |
"resources-list": "./crehana/frontdev/jsx/resources-list.js", | |
"welcome-flux": "./crehana/frontdev/jsx/welcome-flux.js", | |
"tutorials-list": "./crehana/frontdev/jsx/tutorials-list.js", | |
"tutorial-detail": "./crehana/frontdev/jsx/tutorial-detail.js", | |
"customprofile": "./crehana/frontdev/jsx/customprofile.js", | |
"base": "./crehana/frontdev/jsx/base.js", | |
"lessons": "./crehana/frontdev/jsx/lessons.js", | |
"teach": "./crehana/frontdev/jsx/teach.js", | |
"afiliate": "./crehana/frontdev/jsx/afiliate.js", | |
"student-perks": "./crehana/frontdev/jsx/student-perks.js", | |
"login": "./crehana/frontdev/jsx/login.js", | |
"signup": "./crehana/frontdev/jsx/signup.js", | |
"checkout": "./crehana/frontdev/jsx/checkout.js", | |
"fullPageLogin": "./crehana/frontdev/jsx/fullPageLogin.js", | |
"fullPageRegister": "./crehana/frontdev/jsx/fullPageRegister.js", | |
"login-register-modal": "./crehana/frontdev/jsx/login-register-modal.js", | |
"searchbox": "./crehana/frontdev/jsx/searchbox.js", | |
}, | |
// devtool: 'source-map', | |
output: { | |
path: path.join(__dirname, '/crehana/static/js'), | |
filename: "[name].min.js" | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.js$/, | |
exclude: /(node_modules|bower_components)/, | |
loader: "babel-loader" | |
}, | |
{ | |
test: /\.scss$/, | |
use: ExtractTextPlugin.extract([ | |
// "style-loader", | |
"css-loader", | |
"postcss-loader", | |
"sass-loader" | |
]) | |
}, | |
] | |
}, | |
plugins: [ | |
new ExtractTextPlugin({ | |
filename: 'dist/styles/[name].css', | |
allChunks: true | |
}) | |
// new webpack.optimize.UglifyJsPlugin({minimize: true, compress: {warnings: false}}) | |
] | |
} | |
module.exports = function(env) { | |
console.log('env', env); | |
return common; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment