easywebpack-js

webpack javascript build solution for easywebpack

Usage no npm install needed!

<script type="module">
  import easywebpackJs from 'https://cdn.skypack.dev/easywebpack-js';
</script>

README

easywebpack-js

NPM version build status Test coverage David deps npm download

Webpack javascript file compress for easywebpack.

Install

  • Webpack 4
$ npm i easywebpack-js --save-dev
  • Webpack 3
$ npm i easywebpack-js@3 --save-dev

Usage

Node Build Mode

  • write webpack build config for easywebpack-js
// build/index.js
const easywebpack = require('easywebpack-js');
const config = {
  env: process.env.BUILD_ENV,
  entry: {
    'index': 'lib/index.js'
  }
};
easywebpack.build(config);
  • node build mode
{
 "scripts": {
   "build:test": "cross-env BUILD_ENV=test NODE_ENV=development node build/index.js",
   "build:prod": "cross-env BUILD_ENV=prod NODE_ENV=production node build/index.js",
 }
}

easywebpack-cli

  • write easywebpack-cli for easywebpack-js solution
// ${app_root}/webpack.config.js
const easywebpack = require('easywebpack-js');
module.exports = {
  framework: 'js',
  entry: {
    'index': 'lib/index.js'
  }
};
  • easywebpack-cli command build
{
 "scripts": {
   "build:test": "easy build test",
   "build:prod": "easy build prod",
 }
}

License

MIT