问题描述
由于Webkit,我目前正在开发将Typescript转换为NodeJS的Express应用程序。
问题是我开始收到太多与所用软件包有关的警告,而不是与我自己的应用有关的警告。这是一个示例:
WARNING in ./node_modules/express/lib/view.js 81:13-25
Critical dependency: the request of a dependency is an expression
@ ./node_modules/express/lib/application.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/app.ts
@ ./src/server.ts
@ multi webpack/hot/poll?1000 ./src/server.ts
WARNING in ./node_modules/hash-stream-validation/index.js
Module not found: Error: Can't resolve 'fast-crc32c' in '/Users/.../node_modules/hash-stream-validation'
@ ./node_modules/hash-stream-validation/index.js
@ ./node_modules/@google-cloud/storage/build/src/file.js
@ ./node_modules/@google-cloud/storage/build/src/index.js
@ ./src/connectors/google_storage.ts
@ ./src/server/routes/expose_data_handler.ts
@ ./src/app.ts
@ ./src/server.ts
@ multi webpack/hot/poll?1000 ./src/server.ts
有什么办法可以隐藏与包装相关的警告?
这是我正在使用的 webpack.js 配置:
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const { HotModuleReplacementPlugin } = require('webpack');
const path = require('path');
const ENTRY_FILE = 'src/server.ts';
module.exports = {
mode: 'development',entry: ['webpack/hot/poll?1000',path.join(__dirname,ENTRY_FILE)],devtool: 'inline-source-map',devServer: {
contentBase: './dist',hot: true,},plugins: [new CleanWebpackPlugin(),new HotModuleReplacementPlugin()],watch: true,module: {
rules: [
{
exclude: [path.resolve(__dirname,'node_modules')],test: /\.ts$/,use: {
loader: 'ts-loader',options: {
transpileOnly: true,],externals: {
fs: 'commonjs fs',output: {
filename: 'server.js',path: path.resolve(__dirname,'build'),resolve: {
extensions: ['.ts','.js'],target: 'node',};
P.S .:请在评论中告知我是否缺少一些有用的信息来补充。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)