1.5.2 • Published 3 years ago

webpack-es3-plugin v1.5.2

Weekly downloads
63
License
MIT
Repository
github
Last release
3 years ago

webpack-es3-plugin

As the name suggested

Intro

Convert emitted Javascript files by webpack to es3 format

Notice

  • Designed for webpack v4
  • Set optimization.minimize to false
  • If using babel-loader, then set loose to true and modules to "commonjs" in your @babel/env-preset
{
  "presets": [["@babel/preset-env", { "loose": true, "modules": "commonjs" }]]
}

Installation

$ npm i -D webpack-es3-plugin
# or
$ yarn add -D webpack-es3-plugin

Usage

// in your webpack.config.js
const ES3Plugin = require("webpack-es3-plugin");
module.exports = {
  plugins: [new ES3Plugin()]
};

Config

No field is needed by default.

waitFor=() => Promise.resolve()

type waitFor = number | () => Promise<any>;

If passing numbers, then wait for some time to start. Unit is ms.

If a function is passed in, then the plugin will wait till the returned Promise resolves.

// wait for 1000ms
new ES3Plugin({
  waitFor: 1000
});

// or function that returns a Promise
const task = () => {
  return new Promise(resolve => {
    // do something
    resolve();
  });
};

new ES3Plugin({
  waitFor: task
});

onFinish=() => {}

Called when transformation (compile to ES3 compatible) is done.

new ES3Plugin({
  onFinish() {
    // do something
  }
});
1.5.2

3 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago