諸行無常

IT色々お勉強中のブログ

webpack3→4でエラーになった loaders

webpack3→4でエラーになった

✖ 「wds」: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.module has an unknown property 'loaders'. These properties are valid:
   object { defaultRules?, exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exprContextRequest?, noParse?, rules?, strictExportPresence?, strictThisContextOnImports?, unknownContextCritical?, unknownContextRecursive?, unknownContextRegExp?, unknownContextRequest?, unsafeCache?, wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp? }
   -> Options affecting the normal modules (`NormalModuleFactory`).
error Command failed with exit code 1.

webpack.js.org

lodersがrulesに変更したらしい

-    loaders: [
+    rules: [
       vue,

webpack.js.org

module.exports = {
  test: /\.(scss|sass)$/,
  use: ['style-loader', 'css-loader', 'sass-loader']
}

これで解決

続く