This PR updates the templates based on current usability feedback.
It adds an autoInstall = true argument to all templates that do npm installs, where when that argument is not explicitly set for the template, there will instead be an error thrown that a package is missing and needs to be installed like:
Chomp: Some packages are missing. Please run npm install @babel/core @babel/cli
In addition the Babel and SWC templates now use configuration files by default with an argument to disable them.
Template updates:
NPM
Adds a new npm:verify template that is exactly the same as the npm:install template but instead of installing, throws and error stopping all subsequent operations with a failure and informs the user with the message Chomp: Some packages are missing. Please run npm install ....
JSPM
Adds autoInstall
Babel
Adds autoInstall, which applies to both Babel itself and any used plugins or presets (passed as plugins and presets array arguments)
Adds babelRc argument that can be true or false. Default is true.
Adds configFile argument that can be any string to use. Default is none. We could consider defaulting to babel.config.js if it exists, but opting into this while getting the rc automatically is the Babel convention currently.
Swc
Adds autoInstall
Adds swcRc argument that can be true or false, default is true.
Adds configFile argument that can be any string. Default is none.
Adds sourceMaps argument that can be true or false. Default is true.
Adds config argument which is a dictionary of dot-separated configuration options to their values, allowing inline configuration.
Svelte
Adds autoInstall
Adds svelteConfig argument that can be any string, default is none. When set, this file will be imported and used as the configuration to drive the Svelte compilation, thus supporting any arbitrary svelte config. The config.filename is still set to the dependency being compiled though.
This PR updates the templates based on current usability feedback.
It adds an
autoInstall = true
argument to all templates that do npm installs, where when that argument is not explicitly set for the template, there will instead be an error thrown that a package is missing and needs to be installed like:In addition the Babel and SWC templates now use configuration files by default with an argument to disable them.
Template updates:
NPM
npm:verify
template that is exactly the same as thenpm:install
template but instead of installing, throws and error stopping all subsequent operations with a failure and informs the user with the messageChomp: Some packages are missing. Please run npm install ...
.JSPM
autoInstall
Babel
autoInstall
, which applies to both Babel itself and any used plugins or presets (passed as plugins and presets array arguments)babelRc
argument that can be true or false. Default istrue
.configFile
argument that can be any string to use. Default is none. We could consider defaulting tobabel.config.js
if it exists, but opting into this while getting the rc automatically is the Babel convention currently.Swc
autoInstall
swcRc
argument that can be true or false, default istrue
.configFile
argument that can be any string. Default is none.sourceMaps
argument that can be true or false. Default is true.config
argument which is a dictionary of dot-separated configuration options to their values, allowing inline configuration.Svelte
autoInstall
svelteConfig
argument that can be any string, default is none. When set, this file will be imported and used as the configuration to drive the Svelte compilation, thus supporting any arbitrary svelte config. Theconfig.filename
is still set to the dependency being compiled though.