js support es5

This commit is contained in:
pengfei.zhou
2020-01-15 17:24:11 +08:00
committed by osborn
parent 2eddf9cc61
commit 87bd8ca0f9
13 changed files with 16602 additions and 14 deletions

View File

@@ -1,6 +1,6 @@
const path = require('path')
const fs = require('fs')
import resolve from '@rollup/plugin-node-resolve'
import buble from '@rollup/plugin-buble';
import commonjs from '@rollup/plugin-commonjs'
export default [
{
@@ -18,6 +18,25 @@ export default [
console.warn(warning.message);
}
},
{
input: "lib-es5/index.runtime.es5.js",
output: {
name: "doric",
format: "iife",
file: "bundle/doric-sandbox.es5.js",
},
plugins: [
resolve({ mainFields: ["jsnext"] }),
commonjs(),
buble({
transforms: { dangerousForOf: true }
}),
],
onwarn: function (warning) {
if (warning.code === 'THIS_IS_UNDEFINED') { return; }
console.warn(warning.message);
}
},
{
input: "lib/index.js",
output: {
@@ -33,6 +52,24 @@ export default [
console.warn(warning.message);
}
},
{
input: "lib-es5/index.js",
output: {
format: "cjs",
file: "bundle/doric-lib.es5.js",
},
plugins: [
resolve({ mainFields: ["jsnext"] }),
buble({
transforms: { dangerousForOf: true }
}),
],
external: ['reflect-metadata'],
onwarn: function (warning) {
if (warning.code === 'THIS_IS_UNDEFINED') { return; }
console.warn(warning.message);
}
},
{
input: "lib/index.debug.js",
output: {