diff --git a/doric-cli/target/_package.json b/doric-cli/target/_package.json index 6e5b7f3b..ac4fe513 100644 --- a/doric-cli/target/_package.json +++ b/doric-cli/target/_package.json @@ -19,6 +19,7 @@ "devDependencies": { "@rollup/plugin-commonjs": "^11.0.1", "@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" } } \ No newline at end of file diff --git a/doric-cli/target/_rollup.config.js b/doric-cli/target/_rollup.config.js index 5b79ad46..50072b88 100644 --- a/doric-cli/target/_rollup.config.js +++ b/doric-cli/target/_rollup.config.js @@ -3,7 +3,8 @@ import commonjs from '@rollup/plugin-commonjs' import bundles from './build/index' import fs from 'fs' 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) { if (fs.statSync(dirPath).isDirectory()) { @@ -49,6 +50,7 @@ export default plugins: [ resolve({ mainFields: ["jsnext"] }), commonjs(), + json(), ], external: ['reflect-metadata', 'doric'], onwarn: function (warning) { @@ -56,28 +58,30 @@ export default console.warn(warning.message); } } - }).concat( - allFiles - .map(e => e.replace('.ts', '')) - .map(bundle => { - return { - input: `build/${bundle}.js`, - output: { - format: "cjs", - file: `bundle/${bundle}.es5.js`, - sourcemap: true, - }, - plugins: [ - resolve({ mainFields: ["jsnext"] }), - commonjs(), - buble({ - transforms: { dangerousForOf: true } - }), - ], - external: ['reflect-metadata', 'doric'], - onwarn: function (warning) { - if (warning.code === 'THIS_IS_UNDEFINED') { return; } - console.warn(warning.message); - } - } - })) \ No newline at end of file + }) +// If need ES5 support enable following configs + // .concat( + // allFiles + // .map(e => e.replace('.ts', '')) + // .map(bundle => { + // return { + // input: `build/${bundle}.js`, + // output: { + // format: "cjs", + // file: `bundle/${bundle}.es5.js`, + // sourcemap: true, + // }, + // plugins: [ + // resolve({ mainFields: ["jsnext"] }), + // commonjs(), + // buble({ + // transforms: { dangerousForOf: true } + // }), + // ], + // external: ['reflect-metadata', 'doric'], + // onwarn: function (warning) { + // if (warning.code === 'THIS_IS_UNDEFINED') { return; } + // console.warn(warning.message); + // } + // } + // })) \ No newline at end of file diff --git a/doric-cli/target/_tsconfig.json b/doric-cli/target/_tsconfig.json index 8a7c268d..597a9561 100644 --- a/doric-cli/target/_tsconfig.json +++ b/doric-cli/target/_tsconfig.json @@ -53,7 +53,8 @@ // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ /* Experimental Options */ "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": [ "**/*.ts",