gpt4 book ai didi

javascript - 『wds』 : Invalid configuration object. Webpack 已使用与 API 模式不匹配的配置对象初始化

转载 作者:行者123 更新时间:2023-11-30 06:16:55 29 4
gpt4 key购买 nike

我一直在努力寻找一种方法来整理/探索我计算机上数以百万计的鼓声以进行音乐制作,并遇到了 this project并克隆 this github

运行 npm start 后,我收到了 Invalid configuration object 错误。完整日志:

User-2:aiexperiments-drum-machine-master User$ npm start

> drums@1.0.0 start /Users/User/Dropbox/aiexperiments-drum-machine-master
> webpack-dev-server

✖ 「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`).
- configuration.resolve has an unknown property 'modulesDirectories'. These properties are valid:
object { alias?, aliasFields?, cachePredicate?, cacheWithContext?, concord?, descriptionFiles?, enforceExtension?, enforceModuleExtension?, extensions?, fileSystem?, mainFields?, mainFiles?, moduleExtensions?, modules?, plugins?, resolver?, symlinks?, unsafeCache?, useSyncFileSystemCalls? }
-> Options for the resolver
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! drums@1.0.0 start: `webpack-dev-server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the drums@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

最佳答案

webpack.config.js 格式不正确,使用了 the docs 中不存在的非标准键.我已更正错误 - 将您的 webpack.config.js 替换为以下内容:

/**
* Copyright 2016 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

var webpack = require("webpack");

var PROD = JSON.parse(process.env.PROD_ENV || '0');

module.exports = {
"context": __dirname,
entry: {
"Main": "app/Main",
},
output: {
filename: "./build/[name].js",
chunkFilename: "./build/[id].js",
sourceMapFilename : "[file].map",
},
resolve: {
modules: [
"node_modules",
"node_modules/tone",
"app"
],
},
plugins: PROD ? [
new webpack.optimize.UglifyJsPlugin({minimize: true}),
new webpack.DefinePlugin({__DEV__: true})
] : [],
module: {
rules: [
{
test: /\.js$/,
exclude: [/node_modules/],
loader: 'jshint-loader'
},
{
test: /\.scss$/,
loader: "style!css!autoprefixer!sass"
},
{
test: /\.json$/,
loader: "json-loader"
},
{
test: /\.(png|gif)$/,
loader: "url-loader",
},
{
test : /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
loader : "file-loader?name=images/font/[hash].[ext]"
}
]
},
watch: true

};

关于javascript - 『wds』 : Invalid configuration object. Webpack 已使用与 API 模式不匹配的配置对象初始化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55577788/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com