Webpack+Babel building system for StellarExpert utility libraries
npm i -D @stellar-expert/lib-webpack-template webpack-cliCreate file babel.config.js in the project root:
const {createBabelConfig} = require('@stellar-expert/lib-webpack-template')
module.exports = createBabelConfig()
//or add additional plugins (only if needed)
module.exports = createBabelConfig([
['@babel/plugin-proposal-class-properties', {loose: true}]
])Create file webpack-config.js in the project root:
const path = require('path')
const {initWebpackConfig} = require('@stellar-expert/lib-webpack-template')
module.exports = initWebpackConfig({
libName: 'libUniqueName',
inputPath: './index.js',
outputPath: './lib'
})Add the following two script entries to the project's package.json:
{
"scripts": {
"build": "webpack --mode=production --config ./webpack-config.js"
}
}For this building system to properly work with pnpm package manager, it is required to create .npmrc file in the project root.
auto-install-peers=true
shamefully-hoist=true
npm i -D inspectpackIf you have inspectpack package installed, duplicates will be detected automatically.