zoukankan      html  css  js  c++  java
  • Webpack+Typescript 简易配置

    教程: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/**/*"
        ]
    }
    

      

  • 相关阅读:
    Python3安装
    HTML基础
    Python Socket
    python常用模块
    JSON.stringify的三个参数
    判断数组中存在重复元素
    vant-ui表单验证
    如何计算出浏览器的帧数?requestAnimationFrame
    js判断两个区间是否存在交集
    怎么在组件内部判断出是否插入了slot
  • 原文地址:https://www.cnblogs.com/baiqian/p/10372758.html
Copyright © 2011-2022 走看看