Skip to content

Instantly share code, notes, and snippets.

@gardnervickers
Created December 15, 2016 18:34
Show Gist options
  • Save gardnervickers/bb01fff5a3a14406ba2f00042bdae33e to your computer and use it in GitHub Desktop.
Save gardnervickers/bb01fff5a3a14406ba2f00042bdae33e to your computer and use it in GitHub Desktop.
const webpack = require('webpack');
const path = require('path');
const BUILD_DIR = path.resolve(__dirname, 'resources', 'public', 'webpack');
const APP_DIR = path.resolve(__dirname, 'src', 'js');
const config = {
entry: `${APP_DIR}/main.js`,
module: {
loaders: [
{ test: /\.jsx?$/, loaders: ['babel-loader'], exclude: /node_modules/ },
{ test: /\.css$/, loader: "style-loader!css-loader" },
{ test: /.(png|woff(2)?|eot|ttf)(\?[a-z0-9=\.]+)?$/, loader: 'url-loader?limit=100000' },
{ test: /\.svg$/, loader: 'url-loader' },
{ test: /\.less$/, loader: "style!css!less" },
{ test: /\.json$/, loader: 'json-loader' },
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml" }
]
},
output: {
path: BUILD_DIR,
filename: 'bundle.js'
},
resolve: {
extensions: ['', '.js']
},
externals: {
"react": "React",
"react-dom": "ReactDOM",
"react-bootstrap": "BS",
"react-addons-shallow-compare": "React.addons.shallowCompare"
},
node: {
fs: "empty"
}
};
module.exports = config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment