Skip to content

Instantly share code, notes, and snippets.

@braidn
Last active January 4, 2017 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save braidn/4a11487a59f16b196fa7 to your computer and use it in GitHub Desktop.
Save braidn/4a11487a59f16b196fa7 to your computer and use it in GitHub Desktop.
// base config file, rails and hotloader will manage the rest
var path = require("path");
var webpack = require("webpack");
module.exports = {
entry: {
app: [
'webpack-dev-server/client?http://localhost:8080/assets/',
'webpack/hot/only-dev-server',
'./scripts/init.js.jsx'
]},
ouput: {
path: "../app/assets/javascripts",
publicPath: 'http://localhost:8080/javascripts/',
filename: "bundle.js"
},
resolve: {
extensions: ["", ".webpack.js", ".web.js", ".js", ".jsx", ".config.js"]
},
devtool: "#eval-source-map",
module: {
loaders: [
{ test: /\.jsx$/, loaders: ["react-hot", "babel", "jsx-loader"], exclude: /node_modules/ },
{ test: require.resolve("jquery"), loader: "expose?jQuery" },
{ test: require.resolve("jquery"), loader: "expose?$" },
]
}
};
var config = require("./webpack.config");
config.entry = {
app: [
"./scripts/init.js.jsx"
]
};
config.output = {
filename: "bundle.js",
path: "../app/assets/javascripts"
};
config.devtool = {};
module.exports = config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment