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 into one file in the dist folder. The name specified in the package.json file will be used as the file name comibined with a hash value 1. You can also change the file name in bundle.jsName (see Configuration Reference).

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

You can use the modern ES6 syntax and use the ES6 module standard in all of your JavaScript and TypeScript files. With the integrated boilerplate, you are prepared for experimental features (stage 3), such as public and private field declarations in classes and decorators.

JavaScript and TypeScript files will be

  • linted (ESLint)
  • formatted (Prettier)
  • type checked, if needed, by TypeScript
  • compiled (Babel) to run the targeted browsers specified in .browserlistrc. and based on the .babelrc configuration.
  • mangled and minimized (terser)
  • a copyright banner will be added bz using BannerPlugin
  • and finally a source map file will be created if in development mode 2.

  1. Until version 3.4, the JS and CSS files did not contain a hash value. ↩

  2. Until version 3.1, the source map was also produced and used in production mode. ↩