configuration.module has an unknown property 'loaders'

前端 未结 5 1207
生来不讨喜
生来不讨喜 2020-12-12 17:59

my output of error:

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema. -

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-12 18:09

    Working for me below webpack.config.js

    module.exports = {
        entry: [
            '.src/index.js'
        ],
        output:{
            path: __dirname,
            filename: 'app/js/main.js'
        },
        module:{
            rules: [
              { test: /\.css$/, use: 'css-loader' },
              { test: /\.ts$/, use: 'ts-loader' }
            ]
        }
    }
    

提交回复
热议问题