Giter Club home page Giter Club logo

ts-react's Introduction

ts-react

a typeScript + react + webpack project

infomtion

dev

npm run dev

build

npm run build

webpack

配置说明

webpack.common.js

仅说明moduleplugins中的选项

module rules

{
    test: /\.scss$/,

    // 此处需要注意:loader 的顺序是从右向左执行,
    // 即:先 sass-loader 把 scss 编译成 css,再由 css-loader 编译成 css 文件,最后由 style-loader 把 css 插入到 html 中
    use: ['style-loader', 'css-loader', 'sass-loader',
    {
      loader: 'sass-resources-loader', //此处为了公共的sass样式能够全局加载,而不用每个组件都单独引用。
      options: {
        resources: projectRootUrl + '/src/assets/scss/style.scss'
      }
    }
  ]
}

plugins

CleanWebpackPlugin 清理文件夹

HtmlWebpackPlugin 热更新

ProvidePlugin...

OccurrenceOrderPlugin模块排序,可减少文件大小

package.json中配置项说明

--no-inlinevs--inline// 默认开启inline模式,可以通过--no-inline关闭默认

--devtool eval-source-map// 调试模块使用

--hot// 热加载 ps: 据说配置这个后,仍然需要在plugins中配置webpack.HotModuleReplacementPlugin

--colors// 表示给显示出来的进度加点颜色

--content-base// 表示设置目录

--quiet// 控制台中不输出打包的信息

--compress// 开启gzip压缩

--progress// 显示打包的进度

ts-react's People

Contributors

gjk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.