feat:update cli template
This commit is contained in:
parent
438f729ec6
commit
a0d72af82c
@ -19,6 +19,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-commonjs": "^11.0.1",
|
"@rollup/plugin-commonjs": "^11.0.1",
|
||||||
"@rollup/plugin-node-resolve": "^7.0.0",
|
"@rollup/plugin-node-resolve": "^7.0.0",
|
||||||
"@rollup/plugin-buble": "^0.21.0"
|
"@rollup/plugin-buble": "^0.21.0",
|
||||||
|
"@rollup/plugin-json": "^4.0.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,7 +3,8 @@ import commonjs from '@rollup/plugin-commonjs'
|
|||||||
import bundles from './build/index'
|
import bundles from './build/index'
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import buble from '@rollup/plugin-buble';
|
import babel from 'rollup-plugin-babel';
|
||||||
|
import json from '@rollup/plugin-json'
|
||||||
|
|
||||||
function readDirs(dirPath, files) {
|
function readDirs(dirPath, files) {
|
||||||
if (fs.statSync(dirPath).isDirectory()) {
|
if (fs.statSync(dirPath).isDirectory()) {
|
||||||
@ -49,6 +50,7 @@ export default
|
|||||||
plugins: [
|
plugins: [
|
||||||
resolve({ mainFields: ["jsnext"] }),
|
resolve({ mainFields: ["jsnext"] }),
|
||||||
commonjs(),
|
commonjs(),
|
||||||
|
json(),
|
||||||
],
|
],
|
||||||
external: ['reflect-metadata', 'doric'],
|
external: ['reflect-metadata', 'doric'],
|
||||||
onwarn: function (warning) {
|
onwarn: function (warning) {
|
||||||
@ -56,28 +58,30 @@ export default
|
|||||||
console.warn(warning.message);
|
console.warn(warning.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).concat(
|
})
|
||||||
allFiles
|
// If need ES5 support enable following configs
|
||||||
.map(e => e.replace('.ts', ''))
|
// .concat(
|
||||||
.map(bundle => {
|
// allFiles
|
||||||
return {
|
// .map(e => e.replace('.ts', ''))
|
||||||
input: `build/${bundle}.js`,
|
// .map(bundle => {
|
||||||
output: {
|
// return {
|
||||||
format: "cjs",
|
// input: `build/${bundle}.js`,
|
||||||
file: `bundle/${bundle}.es5.js`,
|
// output: {
|
||||||
sourcemap: true,
|
// format: "cjs",
|
||||||
},
|
// file: `bundle/${bundle}.es5.js`,
|
||||||
plugins: [
|
// sourcemap: true,
|
||||||
resolve({ mainFields: ["jsnext"] }),
|
// },
|
||||||
commonjs(),
|
// plugins: [
|
||||||
buble({
|
// resolve({ mainFields: ["jsnext"] }),
|
||||||
transforms: { dangerousForOf: true }
|
// commonjs(),
|
||||||
}),
|
// buble({
|
||||||
],
|
// transforms: { dangerousForOf: true }
|
||||||
external: ['reflect-metadata', 'doric'],
|
// }),
|
||||||
onwarn: function (warning) {
|
// ],
|
||||||
if (warning.code === 'THIS_IS_UNDEFINED') { return; }
|
// external: ['reflect-metadata', 'doric'],
|
||||||
console.warn(warning.message);
|
// onwarn: function (warning) {
|
||||||
}
|
// if (warning.code === 'THIS_IS_UNDEFINED') { return; }
|
||||||
}
|
// console.warn(warning.message);
|
||||||
}))
|
// }
|
||||||
|
// }
|
||||||
|
// }))
|
@ -53,7 +53,8 @@
|
|||||||
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
||||||
/* Experimental Options */
|
/* Experimental Options */
|
||||||
"experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
"experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||||
"emitDecoratorMetadata": true /* Enables experimental support for emitting type metadata for decorators. */
|
"emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||||
|
"resolveJsonModule": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"**/*.ts",
|
"**/*.ts",
|
||||||
|
Reference in New Issue
Block a user