mika-pack-plugin
Advanced tools
+1
-1
| { | ||
| "name": "mika-pack-plugin", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "author": "daryl", | ||
@@ -5,0 +5,0 @@ "scripts": { |
+16
-40
@@ -1,43 +0,19 @@ | ||
| // import { version } from '../package.json'; | ||
| class MyExampleWebpackPlugin { | ||
| // 定义 `apply` 方法 | ||
| apply(compiler) { | ||
| // 指定要追加的事件钩子函数 | ||
| compiler.hooks.compile.tapAsync( | ||
| 'afterCompile', | ||
| (compilation, callback) => { | ||
| console.log('mika kira kira bling bling ~'); | ||
| console.log('Here’s the `compilation` object which represents a single build of assets:', compilation); | ||
| // export default function () { | ||
| // console.log('version ' + version); | ||
| // } | ||
| // export default function () { | ||
| // import('./extra.js').then(({ default: foo }) => console.log(foo)); | ||
| // } | ||
| // const extra = require('./extra.js') | ||
| // 使用 webpack 提供的 plugin API 操作构建结果 | ||
| compilation.addModule(/* ... */); | ||
| // module.exports = { | ||
| // goTheHell, | ||
| // extra | ||
| // } | ||
| // export default { | ||
| // goTheHell, | ||
| // callFuck:()=>{ | ||
| // console.log('ocena') | ||
| // } | ||
| // } | ||
| const ddd = { | ||
| a:123, | ||
| n:333 | ||
| callback(); | ||
| } | ||
| ); | ||
| } | ||
| } | ||
| // export { | ||
| // ddd as default, | ||
| // goTheHell, | ||
| // goTheHellArk | ||
| // } | ||
| function HelloWorldPlugin(options) { | ||
| // Setup the plugin instance with options... | ||
| } | ||
| HelloWorldPlugin.prototype.apply = function(compiler) { | ||
| compiler.plugin('done', function() { | ||
| console.log('Hello World! mika kira~'); | ||
| }); | ||
| }; | ||
| module.exports = HelloWorldPlugin; | ||
| module.exports = MyExampleWebpackPlugin; |
3693
-6.2%47
-28.79%