Add ESM build
parent
78da7f7fb9
commit
ab1ee0613a
|
@ -22,9 +22,11 @@
|
||||||
"url": "https://karamoff.dev"
|
"url": "https://karamoff.dev"
|
||||||
},
|
},
|
||||||
"main": "./dist/shareon.cjs",
|
"main": "./dist/shareon.cjs",
|
||||||
|
"module": "./dist/shareon.mjs",
|
||||||
"unpkg": "./dist/shareon.min.js",
|
"unpkg": "./dist/shareon.min.js",
|
||||||
"exports": {
|
"exports": {
|
||||||
"require": "./dist/shareon.cjs"
|
"require": "./dist/shareon.cjs",
|
||||||
|
"import": "./dist/shareon.mjs"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
|
|
|
@ -70,6 +70,11 @@ if (isDev) {
|
||||||
format: 'cjs',
|
format: 'cjs',
|
||||||
file: `${outputDir}${pkg.name}.cjs`,
|
file: `${outputDir}${pkg.name}.cjs`,
|
||||||
});
|
});
|
||||||
|
output.push({
|
||||||
|
name: pkg.name,
|
||||||
|
format: 'esm',
|
||||||
|
file: `${outputDir}${pkg.name}.mjs`,
|
||||||
|
});
|
||||||
output.push({
|
output.push({
|
||||||
name: pkg.name,
|
name: pkg.name,
|
||||||
format: 'iife',
|
format: 'iife',
|
||||||
|
|
Loading…
Reference in New Issue