[add] same import primitive
This commit is contained in:
9
libtest/index.cjs
Normal file
9
libtest/index.cjs
Normal file
@@ -0,0 +1,9 @@
|
||||
// import {safeImport} from '../lib/safeImport.cjs'
|
||||
const {safeImport} = require('../lib/safeImport.cjs')
|
||||
|
||||
|
||||
|
||||
const classnames = safeImport('classnames','test_src/index.cjs');
|
||||
|
||||
console.log(classnames('hello',"bruh"));
|
||||
|
7
libtest/index.mjs
Normal file
7
libtest/index.mjs
Normal file
@@ -0,0 +1,7 @@
|
||||
import {safeImport} from '../lib/safeImport.cjs'
|
||||
// const {safeImport} = require('../lib/safeImport.cjs')
|
||||
|
||||
|
||||
|
||||
const x = safeImport('classnames','test_src/index/index.cjs');
|
||||
console.log(x('hello'));
|
Reference in New Issue
Block a user