Common Babel configuration for Lightspeed Node.js apps
npm install @lightspeed/babel-preset-node@lightspeed/babel-preset-node
Babel Node.js configuration and plugins in a convenient package.
- ✨ Transpile Node.js (and server-side React when used) TypeScript code to meet Lightspeed Node.js standards
- ➡ Absolute path resolving for root src:
``js
// From anywhere in your app, this will resolve to
import { MyComponent } from 'src/components/MyComponent';
``
1. Install the dependency in your webapp.
`sh`
yarn add @babel/core @lightspeed/babel-preset-node
2. Consume the Babel preset.
`js`
// babel.config.js
module.exports = {
presets: ['@lightspeed/node'],
};
3. Optionally, extend the configuration as you see fit.
`js``
// babel.config.js
module.exports = {
presets: [
[
'@lightspeed/node',
{
'preset-env': {
targets: {
node: '8',
},
},
},
],
],
};