Currently, I am working on a JavaScript application that I am compiling using Webpack. The application is split into two separate bundles - one for the custom code called App
and another for the frameworks called Vendor
.
The App
bundle consists of all the JavaScript files in the app
directory, along with some Sass files which I want to compile into a separate CSS bundle.
After doing some research, I found out that I need to use the extract-text-webpack-plugin
along with a webpack Sass compiler and style loaders to achieve this.
Below is an excerpt from my webpack.config
file:
var webpack = require('webpack')
var ExtractTextPlugin = require("extract-text-webpack-plugin")
// webpack configuration details here...
I have made sure to install the necessary dependencies via npm, including "css-loader", "extract-text-webpack-plugin", "node-sass", "sass-loader", "style-loader", and "webpack".
However, during the bundling process with webpack, I encountered the following errors related to module resolution for css-loader and style-loader.
I currently only include one sass file in my main application file as shown below: require('./styles.scss')
. Can anyone provide insights into why these errors are occurring?