webpack-style-loader

Nested classes not working in CSS Modules with webpack

孤人 提交于 2020-04-16 15:28:11
问题 Im using webpack and css-loader and style-loader to enable css modules in my React app. These are the following setup: Webpack config: module.exports = { mode: "development", entry: __dirname + "/app/index.js", module: { rules: [ { test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" }, { test: /\.css$/, use: [ "style-loader", { loader: "css-loader", options: { modules: true, localIdentName: "[name]__[local]___[hash:base64:5]" } } ] } ] }, output: { filename: "bundle.js", path: _

Webpack [url/file-loader] is not resolving the Relative Path of URL

隐身守侯 提交于 2020-01-22 11:38:51
问题 I am facing a problem in Webpack regarding Relative Path. Let me try to explain the scenario : I have 2 separate project in Workspace directory : Project-A [Bundling using Gulp] : Stable & Working Project-B [Bundling using Webpack] : New project As both the projects are using same Styling, so I wanted to reuse the SCSS files [consisting of standard variables, predefined layouts, modals, classes etc] of Project A into Project B . Now, if I am trying to import Project-A index.scss in Project-B

Webpack [url/file-loader] is not resolving the Relative Path of URL

Deadly 提交于 2020-01-22 11:38:05
问题 I am facing a problem in Webpack regarding Relative Path. Let me try to explain the scenario : I have 2 separate project in Workspace directory : Project-A [Bundling using Gulp] : Stable & Working Project-B [Bundling using Webpack] : New project As both the projects are using same Styling, so I wanted to reuse the SCSS files [consisting of standard variables, predefined layouts, modals, classes etc] of Project A into Project B . Now, if I am trying to import Project-A index.scss in Project-B

Webpack + Firebase: Disable parsing of Firebase

别来无恙 提交于 2020-01-21 05:18:08
问题 I am working on a web app that uses Webpack to bundle modules. For whatever reason, the introduction of Firebase into the app is causing Webpack to throw an error. This error is occurring when Webpack attempts to load the Firebase module. How do I go about excluding Firebase from Webpack, but can still call import Firebase from 'firebase'; from within my JS files? Here are some screenshots of the error. pic1 pic2 回答1: tl;dr Exclude /node_modules/ from the babel-loader paths. Your 2nd pic

loading css url() files in a specific folder with webpack

痴心易碎 提交于 2020-01-14 09:05:30
问题 I'm using a node library that has a css file inside, that css file loads an image like this background-image: url("image.png"); The file "image.png" is being requested at http://localhost:9000/ (the root) is dirty to have images all over the root of the project. Also I have another problem, I don't know why the image file of the module is not being copied to the build folder automatically, only works if I copy the image file manually to the build folder. Playing with Webpack config parameters

webpack with bootstrap.css not work

纵然是瞬间 提交于 2020-01-11 11:53:06
问题 This is my webpack.config.js file: var ExtractTextPlugin = require('extract-text-webpack-plugin'), webpack = require('webpack'); module.exports = { entry: [ './src/app.js', ], output: { path: __dirname + '/../web/js', filename: 'build.js', }, module: { loaders: [ { test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' }, { test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') }, { test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: "url?limit=5000" } ] },