@barusu-react/webpack-rule-tsx
tsx rule of <webpack config>.module.rules
Last updated a month ago by lemonclown .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @barusu-react/webpack-rule-tsx 
SYNC missed versions from official npm registry.

npm version npm download npm license

Usage

  • Install

    yarn add --dev @barusu-react/webpack-rule-tsx
    
  • Use in webpack.config.js/webpack.config.ts

    import path from 'path'
    import { calcTsxRule, calcOutsideJsRule, calcEslintRule } from '@barusu-react/webpack-rule-tsx'
    
    export default {
      ...
      module: {
        rules: [
          ...
          // First, run the linter.
          // It's important to do this before Babel processes the JS.
          {
            calcEslintRule({
              include: path.resolve('src'),
              eslintOptions: {
                resolvePluginsRelativeTo: __dirname,
              }
            })
          },
          {
            // "oneOf" will traverse all following loaders until one will
            // match the requirements. When no loader matches it will fall
            // back to the "file" loader at the end of the loader list.
            oneOf: [
              ...
              // Process application JS with Babel.
              // The preset includes JSX, Flow, TypeScript, and some ESnext features.
              calcTsxRule({
                include: path.resolve('src'),
                isEnvProduction: process.env.NODE_ENV === 'production',
                babelLoaderOptions: { }, // optional
              }),
              // Process any JS outside of the app with Babel.
              // Unlike the application JS, we only compile the standard ES features.
              calcOutsideJsRule({
                shouldUseSourceMap: true,
                babelLoaderOptions: { }, // optional
              }),
              ...
            ]
          }
          ...
        ]
      }
      ...
    }
    

Options

Current Tags

  • 0.0.8                                ...           latest (a month ago)

8 Versions

  • 0.0.8                                ...           a month ago
  • 0.0.7                                ...           2 months ago
  • 0.0.6                                ...           2 months ago
  • 0.0.5                                ...           2 months ago
  • 0.0.4                                ...           2 months ago
  • 0.0.3                                ...           2 months ago
  • 0.0.2                                ...           2 months ago
  • 0.0.1                                ...           3 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 8
Last Month 34
Dependencies (11)
Dev Dependencies (6)

Copyright 2014 - 2016 © taobao.org |