Skip to content

Commit

Permalink
Merge pull request #14 from xcatliu/fixture/add-es3ify
Browse files Browse the repository at this point in the history
Fixture/add es3ify
  • Loading branch information
xcatliu committed Dec 29, 2015
2 parents c6a3787 + 210947b commit 3876978
Show file tree
Hide file tree
Showing 12 changed files with 68 additions and 39,386 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"presets": ["es2015", "stage-0"],
"plugins": [
"add-module-exports",
"transform-object-assign"
]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
node_modules

lib
examples/**/bundle.js*
27 changes: 27 additions & 0 deletions es3ify-webpack-plugin/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* https://github.com/webpack/core/blob/master/lib/CachedSource.js
* https://github.com/webpack/docs/wiki/how-to-write-a-plugin
* https://github.com/webpack/docs/wiki/plugins
* https://github.com/sorrycc/es3ify-loader/blob/master/index.js
* https://github.com/webpack/webpack/blob/67656b90e2c4750a7a347dcefcefdf935fb39e1c/lib/optimize/UglifyJsPlugin.js
*/

var transform = require('es3ify').transform;
var RawSource = require('webpack/lib/RawSource');

function FileListPlugin(options) {}

FileListPlugin.prototype.apply = function(compiler) {
compiler.plugin('compilation', function(compilation) {
compilation.plugin("optimize-chunk-assets", function(chunks, callback) {
chunks.forEach(function(chunk) {
chunk.files.forEach(function(file) {
compilation.assets[file] = new RawSource(transform(compilation.assets[file].source()));
});
});
callback();
});
});
};

module.exports = FileListPlugin;
37 changes: 0 additions & 37 deletions examples/buildAll.js

This file was deleted.

Loading

0 comments on commit 3876978

Please sign in to comment.