@lite-v3/babel-config-vanilla
Shared Vanilla Babel config for Tokopedia Web Services
Installation
npm install @lite-v3/babel-config-vanilla
yarn add @lite-v3/babel-config-vanilla
pnpm install @lite-v3/babel-config-vanilla
Configs
This package has 3 configs which are provided:
Name | Description |
---|
babelClientConfig | A babel config for Tokopedia web service client side |
babelClientLegacyConfig | A babel config for Tokopedia web service client side (Legacy config) |
babelServerConfig | A babel config for Tokopedia web service server side |
Usage
1. Babel Config
Add the following to your babel.config.js
:
module.exports = require('@lite-v3/babel-config-vanilla').babelClientConfig;
The code above is adding babel.config.js
in Tokopedia web service client side
2. Webpack Config
Add the following to your webpack.config.js
:
import webpack from 'webpack';
import { babelServerConfig } from '@lite-v3/babel-config-vanilla';
const webpackConfig = {
...
module: {
rules: [
{
oneOf: [
{
test: /\.(ts|js)x?$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: babelClientConfig
}
}
],
},
]
}
...
}
export default webpackConfig;
The code above is adding webpack.config.js
in Tokopedia web service server side
Code By WPE Team @Tokopedia