2019-07-17 15:03:31 +08:00
|
|
|
const path = require('path')
|
|
|
|
const fs = require('fs')
|
|
|
|
import resolve from 'rollup-plugin-node-resolve'
|
|
|
|
|
|
|
|
export default [
|
|
|
|
{
|
|
|
|
input: "build/index.runtime.js",
|
|
|
|
output: {
|
2019-07-19 10:27:09 +08:00
|
|
|
name: "doric",
|
2019-07-17 15:03:31 +08:00
|
|
|
format: "iife",
|
2019-07-19 10:27:09 +08:00
|
|
|
file: "bundle/doric-sandbox.js",
|
2019-07-17 15:03:31 +08:00
|
|
|
},
|
|
|
|
plugins: [
|
2019-11-11 16:53:04 +08:00
|
|
|
resolve({ mainFields: ["jsnext"] }),
|
2019-11-11 17:03:14 +08:00
|
|
|
],
|
|
|
|
onwarn: function(warning) {
|
|
|
|
if ( warning.code === 'THIS_IS_UNDEFINED' ) { return; }
|
|
|
|
console.warn( warning.message );
|
|
|
|
}
|
2019-07-17 15:03:31 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
input: "build/index.js",
|
|
|
|
output: {
|
|
|
|
format: "cjs",
|
2019-07-19 10:27:09 +08:00
|
|
|
file: "bundle/doric-lib.js",
|
2019-07-17 15:03:31 +08:00
|
|
|
},
|
|
|
|
plugins: [
|
2019-11-11 16:53:04 +08:00
|
|
|
resolve({ mainFields: ["jsnext"] }),
|
2019-07-22 13:52:30 +08:00
|
|
|
],
|
2019-11-11 17:03:14 +08:00
|
|
|
external: ['reflect-metadata'],
|
|
|
|
onwarn: function(warning) {
|
|
|
|
if ( warning.code === 'THIS_IS_UNDEFINED' ) { return; }
|
|
|
|
console.warn( warning.message );
|
|
|
|
}
|
2019-07-17 15:03:31 +08:00
|
|
|
},
|
2019-10-22 18:01:10 +08:00
|
|
|
{
|
|
|
|
input: "build/index.debug.js",
|
|
|
|
output: {
|
|
|
|
format: "cjs",
|
|
|
|
file: "bundle/doric-vm.js",
|
|
|
|
},
|
|
|
|
plugins: [
|
2019-11-11 16:53:04 +08:00
|
|
|
resolve({ mainFields: ["jsnext"] }),
|
2019-10-23 16:00:21 +08:00
|
|
|
],
|
2019-11-11 17:03:14 +08:00
|
|
|
external: ['ws'],
|
|
|
|
onwarn: function(warning) {
|
|
|
|
if ( warning.code === 'THIS_IS_UNDEFINED' ) { return; }
|
|
|
|
console.warn( warning.message );
|
|
|
|
}
|
2019-10-22 18:01:10 +08:00
|
|
|
},
|
2019-07-17 15:03:31 +08:00
|
|
|
]
|