Browse Source

Update webpack config.

feature/python-error-tracking
Drew Larson 8 years ago
parent
commit
79048018c5
  1. 4
      bikeshop_project/package.json
  2. 3
      bikeshop_project/webpack.base.config.js
  3. 8
      bikeshop_project/webpack.prod.config.js

4
bikeshop_project/package.json

@ -16,7 +16,8 @@
"material-ui": "^0.16.6",
"moment": "^2.13.0",
"react": "^15.4.1",
"react-dom": "^15.4.1"
"react-dom": "^15.4.1",
"react-tap-event-plugin": "^2.0.1"
},
"devDependencies": {
"babel": "^6.5.2",
@ -33,7 +34,6 @@
"postcss-loader": "^0.9.1",
"react-addons-css-transition-group": "^15.4.1",
"react-hot-loader": "^1.3.0",
"react-tap-event-plugin": "^1.0.0",
"react-toolbox": "^0.16.2",
"sass-loader": "^3.2.0",
"style-loader": "^0.13.1",

3
bikeshop_project/webpack.base.config.js

@ -27,8 +27,7 @@ module.exports = {
resolve: {
modulesDirectories: [
'node_modules',
'bower_components',
path.resolve(__dirname, './node_modules')
'bower_components'
],
extensions: ['', '.js', '.jsx', '.scss']
},

8
bikeshop_project/webpack.prod.config.js

@ -1,5 +1,6 @@
var webpack = require('webpack')
var BundleTracker = require('webpack-bundle-tracker')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
var config = require('./webpack.base.config.js')
@ -7,6 +8,7 @@ config.output.path = require('path').resolve('./assets/dist')
config.plugins = config.plugins.concat([
new BundleTracker({filename: './webpack-stats-prod.json'}),
new ExtractTextPlugin('react-toolbox.css', {allChunks: true}),
// removes a lot of debugging code in React
new webpack.DefinePlugin({
@ -27,7 +29,11 @@ config.plugins = config.plugins.concat([
// Add a loader for JSX files
config.module.loaders.push(
{ test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel' }
{ test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel' },
{
test: /(\.scss|\.css)$/,
loader: ExtractTextPlugin.extract('style', 'css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass?sourceMap!toolbox')
}
)
module.exports = config
Loading…
Cancel
Save