Skip to content

Instantly share code, notes, and snippets.

@braidn
Last active Jan 4, 2017
Embed
What would you like to do?
// 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