Questions tagged [webpack-style-loader]
461 questions
0
votes
1 answer
webpack css "SyntaxError: Unexpected token {"
I'm new to webpack, trying to configure webpack to pack my CSS files with these loaders:
'use strict';
require('./hosted/.tmp/styles/test.css');
module.exports = {
devtool: 'eval-source-map',
entry: {
js: …

Israel
- 445
- 2
- 5
- 15
0
votes
1 answer
Error from a feature module build in Angular 2, regarding the scss file declared in styleUrls array
This is the NgModule of my feature module:
@NgModule({
imports: [
CommonModule,
FormsModule,
ReactiveFormsModule
],
declarations: [
CustomCardComponent,
StyledDirective
],
exports:…

Donovant
- 3,091
- 8
- 40
- 68
0
votes
0 answers
css-loader failed when include added in webpack.config.js
I have a webpack.config.js file as blow:
let webpack = require('webpack');
module.exports = {
entry: './src/test.css',
output: {
path: "dist",
filename: "app.js"
},
module: {
loaders: [
{ test:…

BD-Joy
- 115
- 8
0
votes
1 answer
Module not found: Error: Cannot resolve 'file' or 'directory' when require a css file inside a directive
From an angular+webpack tutorial, a "directives" folder was created which contains a declaration for the following custom directive
export default ngModule => {
ngModule.directive('kcdHello', () => {
require('./kcd-hello.css');
…

Bardelman
- 2,176
- 7
- 43
- 70
0
votes
2 answers
remove styleurls in "angular2" component
Can anyone help me to add styles using webpack configuration> I searched in many places, but didn't get proper answer .
I need it using sass loading.
I am new to angular2 and webpack too
Please help me?

Manikanta Reddy
- 849
- 9
- 23
0
votes
2 answers
Unable to load CSS via webpack | parser error at *
I have a webpack.config.js like so:
const debug = process.env.NODE_ENV !== 'production';
const webpack = require('webpack');
const precss = require('precss');
const autoprefixer = require('autoprefixer');
module.exports = {
…

Marvin Danig
- 3,738
- 6
- 39
- 71
0
votes
1 answer
Webpack, Object.assign and React-Toolbox trouble
So this is my webpack config file:
var path = require("path");
var webpack = require('webpack');
var BundleTracker = require('webpack-bundle-tracker');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var autoprefixer =…

Webel
- 15
- 4
0
votes
0 answers
IndexRoute styles are loaded even though it's not being displayed
I'm using react-router 2.4.0 with React 15.2.1 and Webpack. I see that styles are being loaded via IndexRoute component (Main, in this example) although it's not being loaded.
Consider the following sources:
AppRouter.js
…

tomericco
- 1,544
- 3
- 19
- 30
0
votes
0 answers
Webpack: generate separate stylesheets per theme
I am using CSS modules to conditionally load the top-level stylesheet (stylus).
This works fine when I am running webpack-dev-server, but I am trying to generate 2 CSS files: theme1.css and theme2.css.
Here is the top-level index.js file.
export…

Abe
- 6,386
- 12
- 46
- 75
0
votes
1 answer
Webpack scss packaging
I am using scss loader to load scss files in my project through webpack. Everything works fine but css.
All the css get formed but leaks out of the components i.e. if same css class is declared outside of my component, it gets overridden by the…
user1845926
0
votes
1 answer
Webpack bundle returns 'Cannot find module' for CSS
I have an app which folders are structured like this:
/app/
|- /assets/
| |- /css/
| |- myapp.css
|- index.html
|- index.js
/dist/
/node_modules/
.babelrc
package.json
webpack.config.js
myapp.css is a simple, plain…

Eduardo C. K. Ferreira
- 354
- 2
- 13
0
votes
1 answer
Configuration for enabling hot style-loader in Webpack for syncing css
I'm trying to enable hot style-loader in Webpack but I can not find the right configuration for it. Here's my webpack.config.js:
const webpack = require('webpack');
const path = require('path');
const buildPath = path.resolve(__dirname,…

Mehran
- 15,593
- 27
- 122
- 221
0
votes
1 answer
Webpack and sass
I'm having issues loading in my scss files with webpack.
I get this error:
Module build failed:
@import 'bulma';
^
Invalid CSS after "...load the styles": expected 1 selector or at-rule, was "content = requi..."
This is my webpack config…

Dileet
- 2,034
- 3
- 33
- 53
0
votes
1 answer
Webpack – circumvent dependency on folder structure inside 3rd party module
Using webpack, I use a require call to load a css file out of the node_modules folder.
Part of my config:
resolve: {
modulesDirectories: ['src/js', 'node_modules'],
},
The actual require call looks like this:…

Sven
- 12,997
- 27
- 90
- 148
0
votes
1 answer
Webpack - Setting path context for various assets and resources when bundle is created
I am working on reactjs application and bundling the application using webpack.
This is how I am setting path for css file in my index.html file.
When I run the command…

SharpCoder
- 18,279
- 43
- 153
- 249