This package contains all dependencies for react-based frontends
- is published on npm as @linguala/common-dev-dependencies
- based on the proposed module setup in react-prototype
It should essentially make it easier to deal with
- ecmascript -> babel-transpilation for each target-platform
- handling these common development dependencies for all linguala-packages in a uniform manner.
This setup builds all ES6+ code for the last 2 browser versions and the currently used node version. Based on the
babel-preset-envit is decided what kind of babel-transforms should be run on the target platform. In comparison:
babel-preset-latestwould just apply all babel transforms that are available. We will save some time and resources with this setup as only a subset of transforms need to run.
Usage in your npm (node package module)
Initialize your module with
npm init which generates a
package.json file folder if you haven't done this already.
@linguala/common-dev-dependencies first install it as a development dependency:
yarn add --dev @linguala/common-dev-dependencies
npm install --save-dev @linguala/common-dev-dependencies
nameChoose a unique name for your package. If it should be published to https://npmjs.com, prefix it with
@linguala/ui-atoms. If it is private add a
mainis the entrypoint for the transpiled ES5 code.
moduleis the entrypoint for all ES6-compatible code if your target platform supports it.
scripts.buildis the command to run babel (as it is a dependency of @linguala/common-dev-dependencies it is available in
npm installwith npm@3+ flat installation)
scripts.prepublishis everything that runs when you run
npm publishto publish on https://www.npmjs.com/org/linguala.
scripts.whatsay what? run with
npm run what, just an example to run commands in the node environment.
package.json from here