教程:https://www.cnblogs.com/yasepix/p/9294499.html
http://developer.egret.com/cn/github/egret-docs/extension/threes/instructions/index.html
npm install webpack webpack-cli typescript ts-loader --save-dev
webpack.config.js
module.exports = { mode: "development", entry: './src/index.ts', target: 'web', output: { filename: 'main.js', path: __dirname + "/dist", libraryTarget: 'umd', library: 'layx', libraryExport: 'default', }, devtool: "source-map", module: { rules: [ { test: /.ts?$/, loader: "ts-loader" } ] }, resolve: { extensions: [".ts", ".tsx", ".js"] } }
tsconfig.js
{ "compilerOptions": { "module": "commonjs", "noImplicitAny": true, "removeComments": true, "target": "es5", "sourceMap": true
"declaration": true
"declarationDir":"./types"
}, "exclude": [ "node_modules", ] }
{ "compilerOptions": { "outDir": "./build", "allowJs": true, "target": "es2015", // "strictNullChecks":true, "experimentalDecorators": true, "noImplicitThis": true, "traceResolution": true
"declaration": true
"declarationDir":"./types"
}, "include": [ "./src/**/*" ] }