s-panferov / awesome-typescript-loader

Awesome TypeScript loader for webpack
Other
2.35k stars 181 forks source link

error width webpack4 #635

Open xiayuxiaoyan opened 5 years ago

xiayuxiaoyan commented 5 years ago

awesome-typescript-loader: 5.2.1 webpack: 4.29.5 ts: 3.3.3333

webpack config: plugins: [ new webpack.NamedChunksPlugin(), new CleanWebpackPlugin(['dist'], { root: path.resolve(__dirname, '../'), }), new webpack.DefinePlugin({ 'process.env.DEPLOY_ENV': JSON.stringify(DEPLOY_ENV), 'process.env.DATE_VERSION': JSON.stringify(DATE_VERSION), }), new webpack.ProvidePlugin({ React: 'react', }), new MiniCssExtractPlugin({ filename: '[name].css', chunkFilename: '[name].[chunkhash].css', }), new CheckerPlugin(), new TsConfigPathsPlugin() ],

报错: /Users/xxx/node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js:16 const target = resolver.ensureHook(this.target); ^ TypeError: resolver.ensureHook is not a function at ModulesInRootPlugin.apply (/Users/xxx/node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js:16:27) at PathPlugin.apply (/Users/xxx/node_modules/awesome-typescript-loader/src/paths-plugin.ts:119:40) at webpack (/Users/xxx/node_modules/webpack/lib/webpack.js:47:13) at Object.<anonymous> (/xxx/build/server.js:39:18) at Module._compile (internal/modules/cjs/loader.js:721:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10) at Module.load (internal/modules/cjs/loader.js:620:32) at tryModuleLoad (internal/modules/cjs/loader.js:560:12) at Function.Module._load (internal/modules/cjs/loader.js:552:3) at Function.Module.runMain (internal/modules/cjs/loader.js:774:12)

xiayuxiaoyan commented 5 years ago

related https://github.com/arcanis/pnp-webpack-plugin/issues/2