Last active
August 29, 2015 14:18
-
-
Save YoruNoHikage/c4e8bdffcaf061201336 to your computer and use it in GitHub Desktop.
[WIP] Webpack for Symfony
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 webpack = require('webpack'); | |
var basedir = __dirname + '/src/Namespace/AppBundle/Resources/views/assets/'; | |
var entry = { | |
// index: 'index', | |
user: 'User/user', | |
game: 'Game/game', | |
}; | |
for(i in entry) { | |
entry[i] = basedir + entry[i]; | |
} | |
module.exports = { | |
entry: entry, | |
output: { | |
path: "./web/", | |
filename: "[name].bundle.js", | |
chunkFilename: "[id].bundle.js" | |
}, | |
module: { | |
loaders: [ | |
{ test: /\.css$/, loader: "style!css" }, | |
{ test: /\.scss/, loader: ExtractTextPlugin.extract("style", "css!sass") }, | |
] | |
}, | |
plugins: [ | |
new webpack.optimize.CommonsChunkPlugin("commons", "commons.js", ["user", "game"]), | |
new ExtractTextPlugin("[name].bundle.css") | |
], | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment