Ajoute une version CDN de la lib (avec toutes les dépendances, pour utiliser directement dans le navigateur)
fix #1211pull/1309/head
parent
0d50e03777
commit
83b9e55d6e
|
@ -25,6 +25,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"build": "node build.js",
|
||||
"clean": "rimraf dist node_modules",
|
||||
"prepare": "yarn run build",
|
||||
"up": "yarn version --minor && echo \"ℹ N'oubliez pas de poussez le tag git\"",
|
||||
"test": "echo 1"
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
"dist/index.js",
|
||||
"dist/types",
|
||||
"dist/images",
|
||||
"dist/publicodes.min.js",
|
||||
"esm"
|
||||
],
|
||||
"private": false,
|
||||
|
|
|
@ -7,17 +7,15 @@ const common = {
|
|||
resolve: {
|
||||
extensions: ['.ts', '.tsx', '.js'],
|
||||
},
|
||||
mode: 'development',
|
||||
mode: process.env.NODE_ENV,
|
||||
entry: path.resolve(__dirname, 'source', 'index.ts'),
|
||||
module: {
|
||||
rules: commonLoaders({ file: false }),
|
||||
},
|
||||
externals:
|
||||
// Every non-relative module is external
|
||||
/^[a-z\-0-9]+$/,
|
||||
|
||||
}
|
||||
|
||||
module.exports =
|
||||
module.exports = [
|
||||
// Config for UMD export (browser / node)
|
||||
{
|
||||
...common,
|
||||
|
@ -27,4 +25,16 @@ module.exports =
|
|||
libraryTarget: 'umd',
|
||||
globalObject: 'this',
|
||||
},
|
||||
externals:
|
||||
// Every non-relative module is external
|
||||
/^[a-z\-0-9]+$/,
|
||||
},
|
||||
process.env.NODE_ENV === 'production' && {
|
||||
...common,
|
||||
output: {
|
||||
filename: 'publicodes.min.js',
|
||||
library: 'publicodes',
|
||||
libraryTarget: 'global',
|
||||
},
|
||||
}
|
||||
].filter(Boolean)
|
Loading…
Reference in New Issue