score:-2
Maybe you doesn't use the sass loader in tour webpack configuration.
Try install this loader: Sass loader
Example of webpack config:
module.exports = {
...
module: {
loaders: [
{
test: /\.scss$/,
loaders: ["style", "css", "sass"]
}
]
}
sassLoader: {
includePaths: [path.resolve(__dirname, "./some-folder")]
}
};
I can suggest also you to use postcss to apply autoprefixer!
score:2
The project that the OP mentioned is using this: https://github.com/kriasoft/isomorphic-style-loader
So yes, another loader + an interface to insert and use the styles.
score:3
You need yet another loader to make css/style loaders to work.
https://www.npmjs.com/package/webpack-isomorphic-tools
But Webpack is made for client side code development only: it finds all require() calls inside your code and replaces them with various kinds of magic to make the things work. If you try to run the same source code outside of Webpack - for example, on a Node.js server - you'll get a ton of SyntaxErrors with Unexpected tokens. That's because on a Node.js server there's no Webpack require() magic happening and it simply tries to require() all the "assets" (styles, images, fonts, OpenGL shaders, etc) as if they were proper javascript-coded modules hence the error message.
Good luck!
Edit:
I think you also want to see this SO question. Importing CSS files in Isomorphic React Components
Source: stackoverflow.com
Related Query
- How to import CSS file on Isomorphic React - Webpack
- How to import a CSS file in a React Component
- How to import CSS modules with Typescript, React and Webpack
- How to import a css file in a react component as raw text?
- how to import css file in react when generating static html and inject imported css into html head tag?
- How to use CSS Modules with webpack in React isomorphic app?
- How to split all import statements of a lazy loaded child component from the main bundle file in react (using webpack 4)
- How to make React CSS import component-scoped?
- How do you center a div element in react w/out external css file
- using css modules, how can I import classes from a file
- How import object from external JS file in React JS using web pack
- How to import the electron ipcRenderer in a react / webpack 2 setup
- How to import scss file as variable in react with typescript
- How to import js modules (with absolute path) in my typescript file in React application?
- how to import HTML file into React component and use it as a component?
- how to import data in react from a js file to use in components
- How to properly import React JSX from separate file in Typescript 1.6
- How to import external css file in nextjs app
- How to import a file into a react app that uses create react app as raw text?
- How to import Json file with React lazy loading?
- How to configure webpack in storybook to allow babel to import react components outside of project folder
- How to import a component or file in React using variables?
- Import css or scss file into Fable/F# React Component?
- In React how to import only needed Bootstrap styles. Bootstrap css modules?
- How to import a sound file into react typescript component?
- How to Import sass file to single components in React
- How to import external css inside jsx file in react?
- react js how to import only the required function from a file and not the all functions
- How to import file from public folder in react application?
- How to import .json file with typescript React App
More Query from same tag
- redux devtools not showing state
- React with TypeScript - how to import methods
- React Router history.push() changed url but did not rendered components content
- How to display value in a column as links using react-bootstrap table-2?
- Best way to wait for another action in flux
- PWA display standalone not working
- Using degrees symbols in React and JSX
- How can i suppress logs from webpack when using react hot reloading?
- "undefined is not an object" this.state not getting bound
- React Select does not show the value when selected
- React & HTML: Highlight a table cell with booleans
- Constructing nested array based on database data
- How to modify an inner property of a nested object in Javascript using a variable reference
- How to apply css on table header of Material ui Table stickyHeader?
- Style disappears in secondary pages
- How do i filter a value of key in an object based on matching value?
- How can i stop localstorage from overwriting itself?
- DetailList fabric ui sorting issue React hooks
- How to have a local instance or React hit a local instance of Django
- React useEffect fetch hook makes endless calls despite array parameter
- Should "component" functions in Om be called directly?
- redirect when user is connected to facebook/google using Reactjs
- How to order an array by keeping certain elements always on top
- Can we change state before making an API call which uses that state? React
- how to add event listener to determine what the coordinates inside a div is clicked?
- Reducing the size of a JSON object array by stripping unwanted object attributes
- React Native Android error trying to nest a view inside a text
- How to ONLY accept video streams from other participants in webRTC video chat without offering my own
- React MapBox I can't change location
- How to use prototype in reactjs