add built in script
This commit is contained in:
parent
ea781e43f9
commit
25a6f08a96
2060
dist/index.js
vendored
2060
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
@ -8,6 +8,20 @@ const sandboxBundle = fs.readFileSync(path.resolve("./node_modules/doric/bundle/
|
|||||||
|
|
||||||
const doricLibBundle = fs.readFileSync(path.resolve("./node_modules/doric/bundle/doric-lib.js"), 'utf-8')
|
const doricLibBundle = fs.readFileSync(path.resolve("./node_modules/doric/bundle/doric-lib.js"), 'utf-8')
|
||||||
|
|
||||||
|
const builtinScript = `
|
||||||
|
/**++++++++SandBox++++++++*/
|
||||||
|
${sandboxBundle}
|
||||||
|
/**--------SandBox--------*/
|
||||||
|
|
||||||
|
/**++++++++Lib++++++++*/
|
||||||
|
Reflect.apply(doric.jsRegisterModule,this,[doric,Reflect.apply(function(__module){(function(module,exports,require){
|
||||||
|
${doricLibBundle}
|
||||||
|
})(__module,__module.exports,doric.__require__);
|
||||||
|
return __module.exports;
|
||||||
|
},this,[{exports:{}}])]);
|
||||||
|
/**--------Lib--------*/
|
||||||
|
`
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
input: `build/index.js`,
|
input: `build/index.js`,
|
||||||
output: {
|
output: {
|
||||||
@ -15,11 +29,10 @@ export default {
|
|||||||
name: "index",
|
name: "index",
|
||||||
file: `dist/index.js`,
|
file: `dist/index.js`,
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
banner: sandboxBundle,
|
banner: builtinScript,
|
||||||
globals: {
|
globals: {
|
||||||
doric: "doric_lib",
|
doric: "doric_lib",
|
||||||
'doric/src/runtime/sandbox': 'doric',
|
'doric/src/runtime/sandbox': 'doric',
|
||||||
doricLibBundle
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
Reference in New Issue
Block a user