0.0.7 • Published 5 years ago

@startselect/js-bundler v0.0.7

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

JS Bundler
This bundler has three main functionalities:

  • Compile JS code and write it to the ./public/dist/ folder
  • Watch for changes in the ./resources/assets/js/ folder
  • Minifies code when using the --minify flag

How to use
Install using NPM: npm install @startselect/js-bundler
Install using Yarn: yarn add @startselect/js-bundler

Development
node ./node_modules/@startselect/js-bundler/src/cli.js build --target ./resources/assets/js/app.js --destination ./public/dist/app.js

Watcher
node ./node_modules/@startselect/js-bundler/src/cli.js watch --target ./resources/assets/js/app.js --destination ./public/dist/app.js

Production
node ./node_modules/@startselect/js-bundler/src/cli.js build --target ./resources/assets/js/app.js --destination ./public/dist/app.js --minify

Transform using babel

You can transform the output to support older browser by creating a .babelrc file which you should put in your project root. Example file:

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "useBuiltIns": "entry"
      }
    ]
  ]
}