mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-26 17:16:11 -05:00
98d0f0de6e
1. changes intl filenames to `[view].intl.js` 2. Move nav/footer rendering to `render.jsx` 3. Set locale cookie before submitting language change form Thanks @thisandagain !
65 lines
1.6 KiB
JavaScript
65 lines
1.6 KiB
JavaScript
var CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
var path = require('path');
|
|
var webpack = require('webpack');
|
|
|
|
var routes = require('./server/routes.json');
|
|
|
|
// Prepare all entry points
|
|
var entry = {
|
|
init: './src/init.js'
|
|
};
|
|
routes.forEach(function (route) {
|
|
entry[route.view] = './src/views/' + route.view + '/' + route.view + '.jsx';
|
|
});
|
|
|
|
// Config
|
|
module.exports = {
|
|
entry: entry,
|
|
devtool: 'source-map',
|
|
externals: {
|
|
'react': 'React',
|
|
'react/addons': 'React',
|
|
'react-dom': 'ReactDOM',
|
|
'react-intl': 'ReactIntl'
|
|
},
|
|
output: {
|
|
path: path.resolve(__dirname, 'build'),
|
|
filename: 'js/[name].bundle.js'
|
|
},
|
|
module: {
|
|
loaders: [
|
|
{
|
|
test: /\.jsx$/,
|
|
loader: 'jsx-loader',
|
|
include: path.resolve(__dirname, 'src')
|
|
},
|
|
{
|
|
test: /\.json$/,
|
|
loader: 'json-loader'
|
|
},
|
|
{
|
|
test: /\.scss$/,
|
|
loader: 'style!css!autoprefixer-loader?browsers=last 3 versions!sass'
|
|
},
|
|
{
|
|
test: /\.(png|jpg|gif|eot|svg|ttf|woff)$/,
|
|
loader: 'url-loader'
|
|
}
|
|
]
|
|
},
|
|
node: {
|
|
fs: 'empty'
|
|
},
|
|
plugins: [
|
|
new CopyWebpackPlugin([
|
|
{from: 'static'},
|
|
{from: 'intl', to: 'js'}
|
|
]),
|
|
new webpack.optimize.UglifyJsPlugin({
|
|
compress: {
|
|
warnings: false
|
|
}
|
|
}),
|
|
new webpack.optimize.OccurenceOrderPlugin()
|
|
]
|
|
};
|