3.0.3 • Published 2 years ago

webpack-shared v3.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

webpack-shared

Shared webpack config

Install

pnpm add -D webpack-shared

Usage

ESModules only

import { join } from 'path'
import HtmlWebpackPlugin from 'html-webpack-plugin'

import {
	shared,
	base,
	css,
	react,
	typescript,
	devServer,
	plugin
} from 'webpack-shared'

// Custom part
function entry() {
	return { entry: './example/index.tsx' }
}

// Custom plugin
const html = plugin(({ template, root }) => {
	return {
		plugins: [
			new HtmlWebpackPlugin({
				template: join(root, template),
				inject: 'body'
			})
		]
	}
})

// Config
export default shared(import.meta.url, [
	base(),
	css(),
	devServer(),
	react(),
	typescript(),

	entry,
	html({ template: 'index.html' })
])

The config parts will be merged by mergeAndConcat from merge-anything library.

See the example app.

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.4

2 years ago

2.1.0

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.3.0

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago