sass-loader

Webpack2 not understanding @import statement in my SASS files (How to compile SASS with webpack2?)

♀尐吖头ヾ 提交于 2019-11-29 10:48:41
Using Webpack 2 and sass-loader 4.11 webpack --config webpack.config.js Here is my webpack.config.js var path = require('path'); var sass = require("./sass/lifeleveler.scss"); module.exports = { entry: './dist/main.js', output: { filename: 'lifeleveler.app.js', path: path.resolve(__dirname, 'dist') }, watch: true, watchOptions: { aggregateTimeout: 300, poll: 1000, ignored: /node_modules/ }, module: { loaders: [ { test: /\.scss$/, include: [ path.resolve(__dirname, 'node_modules'), path.resolve(__dirname, './sass') ], loaders: ["style-loader", "css-loader", "sass-loader"] } ], rules: [ { test:

Webpack - sass loader cannot find images

我的梦境 提交于 2019-11-29 05:32:53
The sass loader doc says: "If you're just generating CSS without passing it to the css-loader, it must be relative to your web root" . So i did as it tells, I have my index.html in my project root , then I'm trying to load an image from my scss file. Now I have 2 errors: 1) from Chrome's console : Cannot find module "./img/header.jpg" . 2) from my terminal : ERROR in ./~/css-loader!./~/sass-loader!./~/resolve-url-loader!./public/css/header.scss Module not found: Error: Cannot resolve 'file' or 'directory' ./img/header.jpg in C:\Web-Development\React\Portfolio\public\css @ ./~/css-loader!./~

Why am I not being able to compile SASS with Webpack?

独自空忆成欢 提交于 2019-11-29 00:08:29
问题 I have the following modules in my Webpack config: module: { preLoaders: [ { test: /\.vue$/, loader: 'eslint', include: projectRoot, exclude: /node_modules/ }, { test: /\.js$/, loader: 'eslint', include: projectRoot, exclude: /node_modules/ } ], loaders: [ { test: /\.vue$/, loader: 'vue' }, { test: /\.js$/, loader: 'babel', include: projectRoot, exclude: /node_modules/ }, { test: /\.json$/, loader: 'json' }, { test: /\.html$/, loader: 'vue-html' }, { test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,

Vue.js + Webpack + vue-loader + bootstrap-sass + sass-loader

旧时模样 提交于 2019-11-28 21:29:04
I'm just getting started with Vue.js + Webpack + vue-loader + bootstrap-sass + sass-loader and I'm a little lost. What I'd like to do is use the SASS version of bootstrap with my SPA Vue.js code. I want to do this so my bootstrap customisations can be done using SASS. Here is what I've done: Created a new Vue.js + webpack project with vue-cli. Installed bootstrap-sass and sass-loader. Added the following to build/webpack.base.conf.js: { test: /\.scss$/, loaders: [ 'style', 'css', 'sass' ] }, { test: /\.(woff2?|ttf|eot|svg)$/, loader: 'url', query: { limit: 10000 } } Created src/style.scss with

Webpack2 not understanding @import statement in my SASS files (How to compile SASS with webpack2?)

自古美人都是妖i 提交于 2019-11-28 04:06:47
问题 Using Webpack 2 and sass-loader 4.11 webpack --config webpack.config.js Here is my webpack.config.js var path = require('path'); var sass = require("./sass/lifeleveler.scss"); module.exports = { entry: './dist/main.js', output: { filename: 'lifeleveler.app.js', path: path.resolve(__dirname, 'dist') }, watch: true, watchOptions: { aggregateTimeout: 300, poll: 1000, ignored: /node_modules/ }, module: { loaders: [ { test: /\.scss$/, include: [ path.resolve(__dirname, 'node_modules'), path

Webpack - sass loader cannot find images

。_饼干妹妹 提交于 2019-11-27 23:05:17
问题 The sass loader doc says: "If you're just generating CSS without passing it to the css-loader, it must be relative to your web root" . So i did as it tells, I have my index.html in my project root , then I'm trying to load an image from my scss file. Now I have 2 errors: 1) from Chrome's console : Cannot find module "./img/header.jpg" . 2) from my terminal : ERROR in ./~/css-loader!./~/sass-loader!./~/resolve-url-loader!./public/css/header.scss Module not found: Error: Cannot resolve 'file'

Vue.js + Webpack + vue-loader + bootstrap-sass + sass-loader

99封情书 提交于 2019-11-27 14:04:40
问题 I'm just getting started with Vue.js + Webpack + vue-loader + bootstrap-sass + sass-loader and I'm a little lost. What I'd like to do is use the SASS version of bootstrap with my SPA Vue.js code. I want to do this so my bootstrap customisations can be done using SASS. Here is what I've done: Created a new Vue.js + webpack project with vue-cli. Installed bootstrap-sass and sass-loader. Added the following to build/webpack.base.conf.js: { test: /\.scss$/, loaders: [ 'style', 'css', 'sass' ] },

webpack (with sass-loader) - scss file @import does not recognize resolve alias

試著忘記壹切 提交于 2019-11-26 20:07:58
问题 My project structure: webpack.config.js app-- --> src ---->> components ------>>> myComponent.js ------>>> myComponent.scss --> styles ---->> variables.scss In webpack.config module.exports: ... resolve: { alias: { styles: path.join(__dirname, 'app/styles') } } In my file - myComponent.scss: @import "styles/variables"; I am getting this error when building bundle.js: Module build failed: @import "styles/variables"; ^ File to import not found or unreadable: styles/variables How can I @import