amireh / happypack

Happiness in the form of faster webpack build times.
MIT License
4.23k stars 124 forks source link

happypack webpack4 typescript loader error #246

Open Yunnkii opened 5 years ago

Yunnkii commented 5 years ago

error:

Uncaught Error: Module parse failed: Unexpected token (5:16)
You may need an appropriate loader to handle this file type.
| import PostList from './biz1/PostList';

webpack.config.js

module: {
    rules: [
      {
        test: '/\.tsx?$/',
        loader:  'happypack/loader?id=ts',
        exclude: /node_modules/
      }
    ]
  },
  plugins: [
    new HappyPack({
      id: 'ts',
      threadPool: happyThreadPool,
      loaders: [
        'babel-loader?cacheDirectory',
        {
          loader: 'ts-loader',
          options: {
            happyPackMode: true,
            transpileOnly: true
          }
        }
      ]
    }),

Anyone know why? Thx

DemonCloud commented 5 years ago

Chinese 总喜欢提一些弱智的问题, 麻烦你自己搞清楚你的配置extension这些对不对再来插件提issue吧

xh4722 commented 5 years ago

Chinese 总喜欢提一些弱智的问题, 麻烦你自己搞清楚你的配置extension这些对不对再来插件提issue吧

请你在回复别人之前先学会尊重人

ghost commented 4 years ago

Chinese 总喜欢提一些弱智的问题, 麻烦你自己搞清楚你的配置extension这些对不对再来插件提issue吧

你不是Chinese? 阿里出你这种几把人?