@stellar-expert/lib-webpack-template

1.0.2 • Public • Published

@stellar-expert/lib-webpack-template

Webpack+Babel building system for StellarExpert utility libraries

Installation

npm i -D @stellar-expert/lib-webpack-template webpack-cli

Usage

Babel configuration

Create 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}]
])

Webpack configuration

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'
})

Build scripts

Add the following two script entries to the project's package.json:

{
  
  "scripts": {
    "build": "webpack --mode=production --config ./webpack-config.js"
  }
}

PNPM support

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

Finding duplicates (optional)

npm i -D inspectpack

If you have inspectpack package installed, duplicates will be detected automatically.

Readme

Keywords

none

Package Sidebar

Install

npm i @stellar-expert/lib-webpack-template

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

12.6 kB

Total Files

6

Last publish

Collaborators

  • orbitlens