2019-12-20 11:18:23 +08:00
|
|
|
import resolve from '@rollup/plugin-node-resolve'
|
2020-01-15 17:24:11 +08:00
|
|
|
import buble from '@rollup/plugin-buble';
|
|
|
|
import commonjs from '@rollup/plugin-commonjs'
|
2019-12-04 14:15:05 +08:00
|
|
|
|
|
|
|
export default [
|
|
|
|
{
|
2020-01-03 14:44:51 +08:00
|
|
|
input: "lib/index.runtime.js",
|
2019-12-04 14:15:05 +08:00
|
|
|
output: {
|
|
|
|
name: "doric",
|
|
|
|
format: "iife",
|
|
|
|
file: "bundle/doric-sandbox.js",
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
resolve({ mainFields: ["jsnext"] }),
|
|
|
|
],
|
2020-01-03 14:44:51 +08:00
|
|
|
onwarn: function (warning) {
|
|
|
|
if (warning.code === 'THIS_IS_UNDEFINED') { return; }
|
|
|
|
console.warn(warning.message);
|
2019-12-04 14:15:05 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2020-01-03 14:44:51 +08:00
|
|
|
input: "lib/index.js",
|
2019-12-04 14:15:05 +08:00
|
|
|
output: {
|
|
|
|
format: "cjs",
|
|
|
|
file: "bundle/doric-lib.js",
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
resolve({ mainFields: ["jsnext"] }),
|
|
|
|
],
|
2020-01-03 14:44:51 +08:00
|
|
|
onwarn: function (warning) {
|
|
|
|
if (warning.code === 'THIS_IS_UNDEFINED') { return; }
|
|
|
|
console.warn(warning.message);
|
2019-12-04 14:15:05 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2020-01-03 14:44:51 +08:00
|
|
|
input: "lib/index.debug.js",
|
2019-12-04 14:15:05 +08:00
|
|
|
output: {
|
|
|
|
format: "cjs",
|
|
|
|
file: "bundle/doric-vm.js",
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
resolve({ mainFields: ["jsnext"] }),
|
|
|
|
],
|
|
|
|
external: ['ws'],
|
2020-01-03 14:44:51 +08:00
|
|
|
onwarn: function (warning) {
|
|
|
|
if (warning.code === 'THIS_IS_UNDEFINED') { return; }
|
|
|
|
console.warn(warning.message);
|
2019-12-04 14:15:05 +08:00
|
|
|
}
|
|
|
|
},
|
2020-01-17 10:12:13 +08:00
|
|
|
|
2020-01-17 14:55:39 +08:00
|
|
|
{
|
|
|
|
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-es5/index.js",
|
|
|
|
output: {
|
|
|
|
format: "cjs",
|
|
|
|
file: "bundle/doric-lib.es5.js",
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
resolve({ mainFields: ["jsnext"] }),
|
|
|
|
buble({
|
|
|
|
transforms: { dangerousForOf: true }
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
onwarn: function (warning) {
|
|
|
|
if (warning.code === 'THIS_IS_UNDEFINED') { return; }
|
|
|
|
console.warn(warning.message);
|
|
|
|
}
|
|
|
|
},
|
2019-12-04 14:15:05 +08:00
|
|
|
]
|