Skip to content

CodeCoupler Webpack Import JS and TS Files

All *.js and *.ts files that you import (starting from src/index.js) will be bundled in one file into the dist folder. The name specified in the package.json will be used as filename comibined with an hash value 1. You can also change the filename in bundle.jsName (see Configuration Reference).

Webpack will start with index.js as entry point. You can write here your init code and import from here further modules.

You can use modern ES6 syntax and use the ES6 modules standard in all of your JavaScript and TypeScript files. Using the integrated Boilerplate you are even prepared for experimental features (stage 3) like public and private field declarations in classes or decorators.

JavaScript and TypeScript files will be

  • linted (ESLint)
  • format checked (Prettier)
  • type checked if needed (typescript)
  • compiled (babel) to run on targeted browsers that are specified in .browserlistrc. and based on the configuration .babelrc
  • mangled and minimized (terser)
  • a copyright banner will be added (BannerPlugin)
  • and finally a source map file will be created if in developing mode 2.

  1. Till 3.4 the JS and CSS files did not contain an hash value 

  2. Till 3.1 the source-map was also produced used in production mode