-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for default loader (file-loader) for unknown modules #7615
Comments
Should this be considered as a separate module type also? Something we may want to consider if no loaders applied. |
@TheLarkInn looks already in maybe https://github.com/webpack/webpack/projects/5#card-10666456 for |
While I think it makes more sense to list all extensions explicitly you can do a module.rules: [{
oneOf: [
{ test: /\.js/, ... },
{ test: /\.ts/, ... },
{ use: "file-loader" }
]
}] |
well that's clever but for some reason it doesn't work with
webpack.config.jsconst MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
module: {
rules: [
{
oneOf: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader"
},
{
test: /\.css$/,
use: [
"mini-css-extract-plugin/dist/loader.js",
"css-loader"
]
},
{
use: "file-loader"
}
]
}
]
},
plugins: [new MiniCssExtractPlugin()]
}; src/index.jsimport "./style.css"; stats.json{
"errors": [
"./src/style.css\nModule build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):\nTypeError: __webpack_require__(...) is not a function\n at Object.<anonymous> (./node_modules/css-loader/index.js!./src/style.css:98:50)\n at __webpack_require__ (./node_modules/css-loader/index.js!./src/style.css:21:30)\n at module.exports.module.exports (./node_modules/css-loader/index.js!./src/style.css:85:18)\n at Object.<anonymous> (./node_modules/css-loader/index.js!./src/style.css:88:10)\n at Module._compile (./node_modules/v8-compile-cache/v8-compile-cache.js:178:30)\n at exec (./node_modules/mini-css-extract-plugin/dist/loader.js:55:10)\n at childCompiler.runAsChild (./node_modules/mini-css-extract-plugin/dist/loader.js:133:14)\n at compile (./node_modules/webpack/lib/Compiler.js:243:11)\n at hooks.afterCompile.callAsync.err (./node_modules/webpack/lib/Compiler.js:500:14)\n at AsyncSeriesHook.eval [as callAsync] (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:15:1)\n at AsyncSeriesHook.lazyCompileHook [as _callAsync] (./node_modules/tapable/lib/Hook.js:35:21)\n at compilation.seal.err (./node_modules/webpack/lib/Compiler.js:497:30)\n at AsyncSeriesHook.eval [as callAsync] (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:6:1)\n at AsyncSeriesHook.lazyCompileHook [as _callAsync] (./node_modules/tapable/lib/Hook.js:35:21)\n at hooks.optimizeAssets.callAsync.err (./node_modules/webpack/lib/Compilation.js:995:35)\n at AsyncSeriesHook.eval [as callAsync] (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:6:1)\n at AsyncSeriesHook.lazyCompileHook [as _callAsync] (./node_modules/tapable/lib/Hook.js:35:21)\n at hooks.optimizeChunkAssets.callAsync.err (./node_modules/webpack/lib/Compilation.js:986:32)\n at _err0 (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:11:1)\n at ./node_modules/uglifyjs-webpack-plugin/dist/index.js:282:11\n at _class.runTasks (./node_modules/uglifyjs-webpack-plugin/dist/uglify/index.js:63:9)\n at UglifyJsPlugin.optimizeFn (./node_modules/uglifyjs-webpack-plugin/dist/index.js:195:16)\n at AsyncSeriesHook.eval [as callAsync] (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:7:1)\n at AsyncSeriesHook.lazyCompileHook [as _callAsync] (./node_modules/tapable/lib/Hook.js:35:21)\n at hooks.additionalAssets.callAsync.err (./node_modules/webpack/lib/Compilation.js:981:36)\n at AsyncSeriesHook.eval [as callAsync] (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:6:1)\n at AsyncSeriesHook.lazyCompileHook [as _callAsync] (./node_modules/tapable/lib/Hook.js:35:21)\n at hooks.optimizeTree.callAsync.err (./node_modules/webpack/lib/Compilation.js:977:32)\n at AsyncSeriesHook.eval [as callAsync] (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:6:1)\n at AsyncSeriesHook.lazyCompileHook [as _callAsync] (./node_modules/tapable/lib/Hook.js:35:21)\n at Compilation.seal (./node_modules/webpack/lib/Compilation.js:914:27)\n at hooks.make.callAsync.err (./node_modules/webpack/lib/Compiler.js:494:17)\n at _err0 (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:11:1)\n at _addModuleChain (./node_modules/webpack/lib/Compilation.js:783:12)\n at processModuleDependencies.err (./node_modules/webpack/lib/Compilation.js:722:9)\n at process._tickCallback (internal/process/next_tick.js:61:11)\n @ ./src/index.js 1:0-21"
],
"warnings": [
"configuration\nThe 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.\nYou can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/"
],
"version": "4.14.0",
"hash": "ea6299e36625e28307d2",
"time": 866,
"builtAt": 1530528426430,
"publicPath": "",
"outputPath": "./dist",
"assetsByChunkName": {
"main": "main.js"
},
"assets": [
{
"name": "32634617ae3a4f18ec07bdf6e4903fe2.js",
"size": 2260,
"chunks": [],
"chunkNames": []
},
{
"name": "main.js",
"size": 5561,
"chunks": [
0
],
"chunkNames": [
"main"
]
}
],
"filteredAssets": 0,
"entrypoints": {
"main": {
"chunks": [
0
],
"assets": [
"main.js"
],
"children": {},
"childAssets": {}
}
},
"namedChunkGroups": {
"main": {
"chunks": [
0
],
"assets": [
"main.js"
],
"children": {},
"childAssets": {}
}
},
"chunks": [
{
"id": 0,
"rendered": true,
"initial": true,
"entry": true,
"size": 4611,
"names": [
"main"
],
"files": [
"main.js"
],
"hash": "1be221368db4547a8529",
"siblings": [],
"parents": [],
"children": [],
"childrenByOrder": {},
"modules": [
{
"id": 0,
"identifier": "./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/index.js!./src/style.css",
"name": "./src/style.css",
"index": 1,
"index2": 0,
"size": 4590,
"cacheable": true,
"built": true,
"optional": false,
"prefetched": false,
"chunks": [
0
],
"issuer": "./node_modules/babel-loader/lib/index.js!./src/index.js",
"issuerId": 1,
"issuerName": "./src/index.js",
"issuerPath": [
{
"id": 1,
"identifier": "./node_modules/babel-loader/lib/index.js!./src/index.js",
"name": "./src/index.js"
}
],
"failed": true,
"errors": 1,
"warnings": 0,
"assets": [],
"reasons": [
{
"moduleId": 1,
"moduleIdentifier": "./node_modules/babel-loader/lib/index.js!./src/index.js",
"module": "./src/index.js",
"moduleName": "./src/index.js",
"type": "harmony side effect evaluation",
"userRequest": "./style.css",
"loc": "1:0-21"
}
],
"usedExports": false,
"providedExports": null,
"optimizationBailout": [
"ModuleConcatenation bailout: Module is not an ECMAScript module"
],
"depth": 1,
"source": "throw new Error(\"Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):\\nTypeError: __webpack_require__(...) is not a function\\n at Object.<anonymous> (./node_modules/css-loader/index.js!./src/style.css:98:50)\\n at __webpack_require__ (./node_modules/css-loader/index.js!./src/style.css:21:30)\\n at module.exports.module.exports (./node_modules/css-loader/index.js!./src/style.css:85:18)\\n at Object.<anonymous> (./node_modules/css-loader/index.js!./src/style.css:88:10)\\n at Module._compile (./node_modules/v8-compile-cache/v8-compile-cache.js:178:30)\\n at exec (./node_modules/mini-css-extract-plugin/dist/loader.js:55:10)\\n at childCompiler.runAsChild (./node_modules/mini-css-extract-plugin/dist/loader.js:133:14)\\n at compile (./node_modules/webpack/lib/Compiler.js:243:11)\\n at hooks.afterCompile.callAsync.err (./node_modules/webpack/lib/Compiler.js:500:14)\\n at AsyncSeriesHook.eval [as callAsync] (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:15:1)\\n at AsyncSeriesHook.lazyCompileHook [as _callAsync] (./node_modules/tapable/lib/Hook.js:35:21)\\n at compilation.seal.err (./node_modules/webpack/lib/Compiler.js:497:30)\\n at AsyncSeriesHook.eval [as callAsync] (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:6:1)\\n at AsyncSeriesHook.lazyCompileHook [as _callAsync] (./node_modules/tapable/lib/Hook.js:35:21)\\n at hooks.optimizeAssets.callAsync.err (./node_modules/webpack/lib/Compilation.js:995:35)\\n at AsyncSeriesHook.eval [as callAsync] (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:6:1)\\n at AsyncSeriesHook.lazyCompileHook [as _callAsync] (./node_modules/tapable/lib/Hook.js:35:21)\\n at hooks.optimizeChunkAssets.callAsync.err (./node_modules/webpack/lib/Compilation.js:986:32)\\n at _err0 (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:11:1)\\n at ./node_modules/uglifyjs-webpack-plugin/dist/index.js:282:11\\n at _class.runTasks (./node_modules/uglifyjs-webpack-plugin/dist/uglify/index.js:63:9)\\n at UglifyJsPlugin.optimizeFn (./node_modules/uglifyjs-webpack-plugin/dist/index.js:195:16)\\n at AsyncSeriesHook.eval [as callAsync] (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:7:1)\\n at AsyncSeriesHook.lazyCompileHook [as _callAsync] (./node_modules/tapable/lib/Hook.js:35:21)\\n at hooks.additionalAssets.callAsync.err (./node_modules/webpack/lib/Compilation.js:981:36)\\n at AsyncSeriesHook.eval [as callAsync] (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:6:1)\\n at AsyncSeriesHook.lazyCompileHook [as _callAsync] (./node_modules/tapable/lib/Hook.js:35:21)\\n at hooks.optimizeTree.callAsync.err (./node_modules/webpack/lib/Compilation.js:977:32)\\n at AsyncSeriesHook.eval [as callAsync] (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:6:1)\\n at AsyncSeriesHook.lazyCompileHook [as _callAsync] (./node_modules/tapable/lib/Hook.js:35:21)\\n at Compilation.seal (./node_modules/webpack/lib/Compilation.js:914:27)\\n at hooks.make.callAsync.err (./node_modules/webpack/lib/Compiler.js:494:17)\\n at _err0 (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:11:1)\\n at _addModuleChain (./node_modules/webpack/lib/Compilation.js:783:12)\\n at processModuleDependencies.err (./node_modules/webpack/lib/Compilation.js:722:9)\\n at process._tickCallback (internal/process/next_tick.js:61:11)\");"
},
{
"id": 1,
"identifier": "./node_modules/babel-loader/lib/index.js!./src/index.js",
"name": "./src/index.js",
"index": 0,
"index2": 1,
"size": 21,
"cacheable": true,
"built": true,
"optional": false,
"prefetched": false,
"chunks": [
0
],
"issuer": null,
"issuerId": null,
"issuerName": null,
"issuerPath": null,
"failed": false,
"errors": 0,
"warnings": 0,
"assets": [],
"reasons": [
{
"moduleId": null,
"moduleIdentifier": null,
"module": null,
"moduleName": null,
"type": "single entry",
"userRequest": "./src",
"loc": "main"
}
],
"usedExports": true,
"providedExports": [],
"optimizationBailout": [
"ModuleConcatenation bailout: Module is an entry point"
],
"depth": 0,
"source": "import \"./style.css\";"
}
],
"filteredModules": 0,
"origins": [
{
"module": "",
"moduleIdentifier": "",
"moduleName": "",
"loc": "main",
"request": "./src",
"reasons": []
}
]
}
],
"modules": [
{
"id": 0,
"identifier": "./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/index.js!./src/style.css",
"name": "./src/style.css",
"index": 1,
"index2": 0,
"size": 4590,
"cacheable": true,
"built": true,
"optional": false,
"prefetched": false,
"chunks": [
0
],
"issuer": "./node_modules/babel-loader/lib/index.js!./src/index.js",
"issuerId": 1,
"issuerName": "./src/index.js",
"issuerPath": [
{
"id": 1,
"identifier": "./node_modules/babel-loader/lib/index.js!./src/index.js",
"name": "./src/index.js"
}
],
"failed": true,
"errors": 1,
"warnings": 0,
"assets": [],
"reasons": [
{
"moduleId": 1,
"moduleIdentifier": "./node_modules/babel-loader/lib/index.js!./src/index.js",
"module": "./src/index.js",
"moduleName": "./src/index.js",
"type": "harmony side effect evaluation",
"userRequest": "./style.css",
"loc": "1:0-21"
}
],
"usedExports": false,
"providedExports": null,
"optimizationBailout": [
"ModuleConcatenation bailout: Module is not an ECMAScript module"
],
"depth": 1,
"source": "throw new Error(\"Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):\\nTypeError: __webpack_require__(...) is not a function\\n at Object.<anonymous> (./node_modules/css-loader/index.js!./src/style.css:98:50)\\n at __webpack_require__ (./node_modules/css-loader/index.js!./src/style.css:21:30)\\n at module.exports.module.exports (./node_modules/css-loader/index.js!./src/style.css:85:18)\\n at Object.<anonymous> (./node_modules/css-loader/index.js!./src/style.css:88:10)\\n at Module._compile (./node_modules/v8-compile-cache/v8-compile-cache.js:178:30)\\n at exec (./node_modules/mini-css-extract-plugin/dist/loader.js:55:10)\\n at childCompiler.runAsChild (./node_modules/mini-css-extract-plugin/dist/loader.js:133:14)\\n at compile (./node_modules/webpack/lib/Compiler.js:243:11)\\n at hooks.afterCompile.callAsync.err (./node_modules/webpack/lib/Compiler.js:500:14)\\n at AsyncSeriesHook.eval [as callAsync] (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:15:1)\\n at AsyncSeriesHook.lazyCompileHook [as _callAsync] (./node_modules/tapable/lib/Hook.js:35:21)\\n at compilation.seal.err (./node_modules/webpack/lib/Compiler.js:497:30)\\n at AsyncSeriesHook.eval [as callAsync] (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:6:1)\\n at AsyncSeriesHook.lazyCompileHook [as _callAsync] (./node_modules/tapable/lib/Hook.js:35:21)\\n at hooks.optimizeAssets.callAsync.err (./node_modules/webpack/lib/Compilation.js:995:35)\\n at AsyncSeriesHook.eval [as callAsync] (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:6:1)\\n at AsyncSeriesHook.lazyCompileHook [as _callAsync] (./node_modules/tapable/lib/Hook.js:35:21)\\n at hooks.optimizeChunkAssets.callAsync.err (./node_modules/webpack/lib/Compilation.js:986:32)\\n at _err0 (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:11:1)\\n at ./node_modules/uglifyjs-webpack-plugin/dist/index.js:282:11\\n at _class.runTasks (./node_modules/uglifyjs-webpack-plugin/dist/uglify/index.js:63:9)\\n at UglifyJsPlugin.optimizeFn (./node_modules/uglifyjs-webpack-plugin/dist/index.js:195:16)\\n at AsyncSeriesHook.eval [as callAsync] (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:7:1)\\n at AsyncSeriesHook.lazyCompileHook [as _callAsync] (./node_modules/tapable/lib/Hook.js:35:21)\\n at hooks.additionalAssets.callAsync.err (./node_modules/webpack/lib/Compilation.js:981:36)\\n at AsyncSeriesHook.eval [as callAsync] (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:6:1)\\n at AsyncSeriesHook.lazyCompileHook [as _callAsync] (./node_modules/tapable/lib/Hook.js:35:21)\\n at hooks.optimizeTree.callAsync.err (./node_modules/webpack/lib/Compilation.js:977:32)\\n at AsyncSeriesHook.eval [as callAsync] (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:6:1)\\n at AsyncSeriesHook.lazyCompileHook [as _callAsync] (./node_modules/tapable/lib/Hook.js:35:21)\\n at Compilation.seal (./node_modules/webpack/lib/Compilation.js:914:27)\\n at hooks.make.callAsync.err (./node_modules/webpack/lib/Compiler.js:494:17)\\n at _err0 (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:11:1)\\n at _addModuleChain (./node_modules/webpack/lib/Compilation.js:783:12)\\n at processModuleDependencies.err (./node_modules/webpack/lib/Compilation.js:722:9)\\n at process._tickCallback (internal/process/next_tick.js:61:11)\");"
},
{
"id": 1,
"identifier": "./node_modules/babel-loader/lib/index.js!./src/index.js",
"name": "./src/index.js",
"index": 0,
"index2": 1,
"size": 21,
"cacheable": true,
"built": true,
"optional": false,
"prefetched": false,
"chunks": [
0
],
"issuer": null,
"issuerId": null,
"issuerName": null,
"issuerPath": null,
"failed": false,
"errors": 0,
"warnings": 0,
"assets": [],
"reasons": [
{
"moduleId": null,
"moduleIdentifier": null,
"module": null,
"moduleName": null,
"type": "single entry",
"userRequest": "./src",
"loc": "main"
}
],
"usedExports": true,
"providedExports": [],
"optimizationBailout": [
"ModuleConcatenation bailout: Module is an entry point"
],
"depth": 0,
"source": "import \"./style.css\";"
}
],
"filteredModules": 0,
"children": [
{
"errors": [],
"warnings": [],
"publicPath": "",
"outputPath": "./dist",
"assetsByChunkName": {},
"assets": [
{
"name": "32634617ae3a4f18ec07bdf6e4903fe2.js",
"size": 2260,
"chunks": [],
"chunkNames": []
}
],
"filteredAssets": 0,
"entrypoints": {
"mini-css-extract-plugin": {
"chunks": [
0
],
"assets": [
"*"
],
"children": {},
"childAssets": {}
}
},
"namedChunkGroups": {
"mini-css-extract-plugin": {
"chunks": [
0
],
"assets": [
"*"
],
"children": {},
"childAssets": {}
}
},
"chunks": [
{
"id": 0,
"rendered": true,
"initial": true,
"entry": true,
"size": 265,
"names": [
"mini-css-extract-plugin"
],
"files": [
"*"
],
"hash": "3716ea1b8286787cc45e",
"siblings": [],
"parents": [],
"children": [],
"childrenByOrder": {},
"modules": [
{
"id": 0,
"identifier": "./node_modules/file-loader/dist/cjs.js!./node_modules/css-loader/lib/css-base.js",
"name": "./node_modules/css-loader/lib/css-base.js",
"index": 1,
"index2": 0,
"size": 81,
"cacheable": true,
"built": true,
"optional": false,
"prefetched": false,
"chunks": [
0
],
"issuer": "./node_modules/css-loader/index.js!./src/style.css",
"issuerId": 1,
"issuerName": "./node_modules/css-loader!./src/style.css",
"issuerPath": [
{
"id": 1,
"identifier": "./node_modules/css-loader/index.js!./src/style.css",
"name": "./node_modules/css-loader!./src/style.css"
}
],
"failed": false,
"errors": 0,
"warnings": 0,
"assets": [
"32634617ae3a4f18ec07bdf6e4903fe2.js"
],
"reasons": [
{
"moduleId": 1,
"moduleIdentifier": "./node_modules/css-loader/index.js!./src/style.css",
"module": "./node_modules/css-loader!./src/style.css",
"moduleName": "./node_modules/css-loader!./src/style.css",
"type": "cjs require",
"userRequest": "../node_modules/css-loader/lib/css-base.js",
"loc": "1:27-80"
}
],
"usedExports": true,
"providedExports": null,
"optimizationBailout": [
"ModuleConcatenation bailout: Module is not an ECMAScript module"
],
"depth": 1,
"source": "module.exports = __webpack_public_path__ + \"32634617ae3a4f18ec07bdf6e4903fe2.js\";"
},
{
"id": 1,
"identifier": "./node_modules/css-loader/index.js!./src/style.css",
"name": "./node_modules/css-loader!./src/style.css",
"index": 0,
"index2": 1,
"size": 184,
"cacheable": true,
"built": true,
"optional": false,
"prefetched": false,
"chunks": [
0
],
"issuer": null,
"issuerId": null,
"issuerName": null,
"issuerPath": null,
"failed": false,
"errors": 0,
"warnings": 0,
"assets": [],
"reasons": [
{
"moduleId": null,
"moduleIdentifier": null,
"module": null,
"moduleName": null,
"type": "single entry",
"userRequest": "!!./node_modules/css-loader/index.js!./src/style.css",
"loc": "mini-css-extract-plugin"
}
],
"usedExports": true,
"providedExports": null,
"optimizationBailout": [
"ModuleConcatenation bailout: Module is not an ECMAScript module"
],
"depth": 0,
"source": "exports = module.exports = require(\"../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"body { color: hotpink }\\n\", \"\"]);\n\n// exports\n"
}
],
"filteredModules": 0,
"origins": [
{
"module": "",
"moduleIdentifier": "",
"moduleName": "",
"loc": "mini-css-extract-plugin",
"request": "!!./node_modules/css-loader/index.js!./src/style.css",
"reasons": []
}
]
}
],
"modules": [
{
"id": 0,
"identifier": "./node_modules/file-loader/dist/cjs.js!./node_modules/css-loader/lib/css-base.js",
"name": "./node_modules/css-loader/lib/css-base.js",
"index": 1,
"index2": 0,
"size": 81,
"cacheable": true,
"built": true,
"optional": false,
"prefetched": false,
"chunks": [
0
],
"issuer": "./node_modules/css-loader/index.js!./src/style.css",
"issuerId": 1,
"issuerName": "./node_modules/css-loader!./src/style.css",
"issuerPath": [
{
"id": 1,
"identifier": "./node_modules/css-loader/index.js!./src/style.css",
"name": "./node_modules/css-loader!./src/style.css"
}
],
"failed": false,
"errors": 0,
"warnings": 0,
"assets": [
"32634617ae3a4f18ec07bdf6e4903fe2.js"
],
"reasons": [
{
"moduleId": 1,
"moduleIdentifier": "./node_modules/css-loader/index.js!./src/style.css",
"module": "./node_modules/css-loader!./src/style.css",
"moduleName": "./node_modules/css-loader!./src/style.css",
"type": "cjs require",
"userRequest": "../node_modules/css-loader/lib/css-base.js",
"loc": "1:27-80"
}
],
"usedExports": true,
"providedExports": null,
"optimizationBailout": [
"ModuleConcatenation bailout: Module is not an ECMAScript module"
],
"depth": 1,
"source": "module.exports = __webpack_public_path__ + \"32634617ae3a4f18ec07bdf6e4903fe2.js\";"
},
{
"id": 1,
"identifier": "./node_modules/css-loader/index.js!./src/style.css",
"name": "./node_modules/css-loader!./src/style.css",
"index": 0,
"index2": 1,
"size": 184,
"cacheable": true,
"built": true,
"optional": false,
"prefetched": false,
"chunks": [
0
],
"issuer": null,
"issuerId": null,
"issuerName": null,
"issuerPath": null,
"failed": false,
"errors": 0,
"warnings": 0,
"assets": [],
"reasons": [
{
"moduleId": null,
"moduleIdentifier": null,
"module": null,
"moduleName": null,
"type": "single entry",
"userRequest": "!!./node_modules/css-loader/index.js!./src/style.css",
"loc": "mini-css-extract-plugin"
}
],
"usedExports": true,
"providedExports": null,
"optimizationBailout": [
"ModuleConcatenation bailout: Module is not an ECMAScript module"
],
"depth": 0,
"source": "exports = module.exports = require(\"../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"body { color: hotpink }\\n\", \"\"]);\n\n// exports\n"
}
],
"filteredModules": 0,
"children": [],
"name": "mini-css-extract-plugin node_modules/css-loader/index.js!src/style.css"
}
]
}
|
hmm... seem like some file is loaded with the file-loader which should not be loaded with it... Do you have the stats output of the child compilation? |
I have updated previous comment. |
Your config loads all Maybe add a rule like that |
make sense, now it works, that solves problem for me, thanks for help, final config: const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
module: {
rules: [
{
oneOf: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader"
},
{
test: /\.css$/,
use: ["mini-css-extract-plugin/dist/loader.js", "css-loader"]
},
{
exclude: /\.(js|mjs|json|wasm)$/,
use: "file-loader"
}
]
}
]
},
plugins: [new MiniCssExtractPlugin()]
}; |
This issue had no activity for at least half a year. It's subject to automatic issue closing if there is no activity in the next 15 days. |
Bump |
This issue had no activity for at least half a year. It's subject to automatic issue closing if there is no activity in the next 15 days. |
Bump, maybe we can do this for webpack@5 |
I don't why |
This issue had no activity for at least three months. It's subject to automatic issue closing if there is no activity in the next 15 days. |
Unstale |
bump |
Issue was closed because of inactivity. If you think this is still a valid issue, please file a new issue with additional information. |
Feature request
from facebook/create-react-app#667 (comment):
What is the expected behavior?
Non-javascript files without loader will be handled by
file-loader
, this can be configured inmodule.fallbackLoader
.What is motivation or use case for adding/changing the behavior?
Nowadays you need to list all of extensions yourself:
How should this be implemented in your opinion?
Are you willing to work on this yourself?
yes
The text was updated successfully, but these errors were encountered: