Created
August 29, 2015 09:06
-
-
Save darklight721/f2c8d496529738586c68 to your computer and use it in GitHub Desktop.
Sample webpack config with promise/fetch shimming
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 characters
{ | |
"name": "SampleWebpack", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"webpack": "./node_modules/.bin/webpack", | |
"bundle": "npm run webpack -- -p", | |
"start": "npm run webpack -- -d --watch" | |
}, | |
"author": "", | |
"license": "ISC", | |
"devDependencies": { | |
"babel-core": "^5.8.23", | |
"babel-loader": "^5.3.2", | |
"exports-loader": "^0.6.2", | |
"promise": "^7.0.4", | |
"webpack": "^1.12.0", | |
"whatwg-fetch": "^0.9.0" | |
} | |
} |
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 characters
var webpack = require('webpack'); | |
module.exports = { | |
entry: { | |
monitors: './monitors/', | |
patients: './patients/' | |
}, | |
output: { | |
path: './bundles/', | |
filename: '[name].js' | |
}, | |
resolve: { | |
alias: { | |
root: __dirname | |
} | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /\.jsx?$/, | |
exclude: /node_modules/, | |
loader: 'babel' | |
} | |
] | |
}, | |
plugins: [ | |
new webpack.ProvidePlugin({ | |
'Promise': 'promise/lib/es6-extensions', | |
'fetch': 'exports?window.fetch!whatwg-fetch' | |
}) | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment