Created
September 15, 2015 13:55
-
-
Save madx/53853c3d7b527744917f to your computer and use it in GitHub Desktop.
Revisions
-
madx created this gist
Sep 15, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,70 @@ const path = require("path") const fs = require("fs") // -- Webpack configuration -- const config = {} // Application entry point config.entry = "./src/server/index.js" // We build for node config.target = "node" // Node module dependencies should not be bundled config.externals = fs.readdirSync("node_modules") .reduce(function(acc, mod) { if (mod === ".bin") { return acc } acc[mod] = "commonjs " + mod return acc }, {}) // We are outputting a real node app! config.node = { console: false, global: false, process: false, Buffer: false, __filename: false, __dirname: false, } // Output files in the build/ folder config.output = { path: path.join(__dirname, "build"), filename: "[name].js", } config.resolve = { extensions: [ "", ".js", ".json", ], } config.module = {} config.module.loaders = [ // Use babel and eslint to build and validate JavaScript { test: /\.js$/, exclude: /node_modules/, loaders: [ "babel?{stage:0,jsxPragma:'this.createElement'}", "eslint", ], }, // Allow loading of JSON files { test: /\.json$/, loader: "json", }, ] module.exports = config