Skip to content

Commit

Permalink
Use ProvidePlugin to provide 6to5 runtime instead of imports-loader.
Browse files Browse the repository at this point in the history
This is required because the runtime tries to export to the window rather than
return the runtime as a module.
  • Loading branch information
STRML committed Dec 30, 2014
1 parent 3fcfe76 commit 86c42c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"6to5": "^2.2.0",
"6to5-loader": "^1.0.0",
"css-loader": "^0.9.0",
"exports-loader": "^0.6.2",
"imports-loader": "^0.6.3",
"jsxhint": "^0.9.0",
"lodash": "^2.4.1",
Expand Down
8 changes: 5 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ module.exports = {
},
module: {
loaders: [
{test: /\.jsx?$/, exclude: /node_modules/, loader: '6to5-loader?experimental=true&runtime=true'},
{test: /\.jsx?$/, exclude: /node_modules/, loader: 'imports-loader?to5Runtime=6to5/runtime'},
{test: /\.jsx?$/, exclude: /node_modules/, loader: '6to5-loader?experimental=true&runtime=true'}
]
},
plugins: [
Expand All @@ -27,7 +26,10 @@ module.exports = {
new webpack.optimize.CommonsChunkPlugin(
"commons", "commons.js"),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.DedupePlugin()
new webpack.optimize.DedupePlugin(),
new webpack.ProvidePlugin({
to5Runtime: "imports?global=>{}!exports-loader?global.to5Runtime!6to5/runtime"
})
],
resolve: {
extensions: ["", ".webpack.js", ".web.js", ".js", ".jsx"],
Expand Down

0 comments on commit 86c42c6

Please sign in to comment.