This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-js/rollup.config.js

51 lines
1.3 KiB
JavaScript
Raw Normal View History

2019-12-04 14:15:05 +08:00
const path = require('path')
const fs = require('fs')
import resolve from '@rollup/plugin-node-resolve'
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"] }),
],
external: ['reflect-metadata'],
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
}
},
]