Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Webpack 2: extract sass #345

Closed
Rincewind3d opened this issue Jan 20, 2017 · 1 comment
Closed

Webpack 2: extract sass #345

Rincewind3d opened this issue Jan 20, 2017 · 1 comment

Comments

@Rincewind3d
Copy link

Rincewind3d commented Jan 20, 2017

I'm migrating a Webpack 1 project to Webpack 2.

  "dependencies": {
    ...
    "css-loader": "^0.26.1",    "expose-loader": "^0.7.1",
    "extract-text-webpack-plugin": "2.0.0-beta.5",
    ...
    "node-sass": "^3.4.2",
    ...
    "resolve-url-loader": "^1.4.3",
    "sass-loader": "^4.1.1",
    "style-loader": "^0.13.0",
    ...
    "webpack": "^2.2.0"
  }
...
	rules: [
		{
			test: /\.scss$/,
			use: [{
				loader: ExtractTextPlugin.extract({
					fallbackLoader: 'style-loader',
					loader: [
						'css-loader?sourceMap',
						'resolve-url-loader',
						'sass-loader?sourceMap'
					]
				})
			}]
		},
		{
			test: /\.css$/,
			use: [{

				loader: ExtractTextPlugin.extract({
					fallbackLoader: 'style-loader',
					loader: [
						'css-loader?sourceMap',
						'resolve-url-loader'
					]
				})

			}]
		}],
...

Leads to:


 ERROR in ./~/bootstrap-sass/assets/stylesheets/_bootstrap.scss
    Module parse failed: webpack/login/node_modules/extract-text-webpack-plugin/loader.js?{"omit":1,"remove":true}!style-loader!css-loader?sourceMap!resolve-url-loader!sass-loader?sourceMap!webpack/login/node_modules/bootstrap-sass/assets/stylesheets/_bootstrap.scss Unexpected character '@' (8:0)
    You may need an appropriate loader to handle this file type.
    | 
    | // Core variables and mixins
    | @import "bootstrap/variables";
    | @import "bootstrap/mixins";
    | 
     @ ./src/entries/basic.js 6:0-60
    
    ERROR in ./~/bootstrap-sass/assets/stylesheets/_bootstrap.scss
    Module build failed: Error
        at webpack/login/node_modules/webpack/lib/NormalModule.js:208:34
        at webpack/login/node_modules/webpack/lib/NormalModule.js:162:10
        at webpack/login/node_modules/loader-runner/lib/LoaderRunner.js:365:3
        at iterateNormalLoaders (webpack/login/node_modules/loader-runner/lib/LoaderRunner.js:206:10)
        at webpack/login/node_modules/loader-runner/lib/LoaderRunner.js:197:4
        at webpack/login/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:62:14
        at _combinedTickCallback (internal/process/next_tick.js:67:7)
        at process._tickCallback (internal/process/next_tick.js:98:9)

``
@bebraw
Copy link
Contributor

bebraw commented Jan 20, 2017

It doesn't work with use properly yet. See #265 for more details (dupe).

@bebraw bebraw closed this as completed Jan 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants