-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage with Webpack #153
Comments
I now realise that the above is an incredibly bad way to write an issue, so I'll offer some more clarification. I am using the latest Webpack 2 beta (2.1.0-beta.27) by the way, I'm sure its the reason it isn't working. This is the error I have: ERROR in ./~/css-loader!./~/sass-loader!./assets/src/scss/kickoff.scss
Module build failed:
@import "kickoff-utils"; // https://github.com/mrmartineau/kickoff-utils.scss
^
File to import not found or unreadable: kickoff-utils
Parent style sheet: stdin
in /Users/mrmartineau/htdocs/trykickoff/kickoff/assets/src/scss/kickoff.scss (line 37, column 1)
@ ./~/style-loader!./~/css-loader!./~/sass-loader!./assets/src/scss/kickoff.scss 4:14-130 This is part of my webpack.config.js (remember I'm using webpack 2) // Eyeglass config
const eyeglass = new Eyeglass({
// outputStyle: 'compressed',
eyeglass: {
root: paths.root,
buildDir: path.resolve(paths.dist, 'css'),
},
});
// inside the `module.rules` array
{
test: /\.scss$/,
use: [
'style-loader',
{loader: 'css-loader',},
{loader: 'sass-loader', options: {sassLoader: eyeglass.options}},
],
} |
This is how I have things set up, I couldn't get the new
|
Has anyone gotten this working with the stable version of Webpack 2, with the |
It's not working for me either. I'm getting const marked = require('marked')
const renderer = new marked.Renderer()
const eyeglass = require('eyeglass')
const LoaderOptionsPlugin = require('webpack').LoaderOptionsPlugin
module.exports = {
webpack: (config, { dev }) => {
config.resolve = {
'extensions': ['.js', '.jsx']
}
config.module.rules.push(
{ test: /\.(md|s?css)$/,
use: [{
loader: 'emit-file-loader',
options: {
name: 'dist/[path][name].[ext]'
}
}]
},
{ test: /\.css$/,
use: ['babel-loader', 'raw-loader', 'postcss-loader']
},
{ test: /\.s(a|c)ss$/,
use: ['babel-loader', 'raw-loader', 'postcss-loader', 'sass-loader']
},
{ test: /\.md$/,
use: [
'html-loader',
{ loader: 'markdown-loader',
// https://github.com/chjj/marked#options-1
options: {
sanitize: true,
smartypants: true,
renderer
}
}
]
}
)
config.plugins.push(new LoaderOptionsPlugin({
test: /\.s(a|c)ss$/,
options: {
sassLoader: eyeglass({
// sass options...
eyeglass: {
// eyeglass options...
}
})
}
}))
// Important: return the modified config
return config
}
} This is actually a |
I was able to use eyeglass with sass-loader in recent webpack: [...]
{
test: /\.scss$/,
include: config.paths.assets,
use: ExtractTextPlugin.extract({
fallback: 'style',
publicPath: '../',
use: [
`css?${sourceMapQueryStr}`,
'postcss',
`resolve-url?${sourceMapQueryStr}`,
{
loader: `sass?${sourceMapQueryStr}`,
options: eyeglass({
// sass options...
includePaths: ['/share/scss/'],
eyeglass: {
// eyeglass options
}
})
}
],
}),
},
[...] |
@strarsis your solution works perfectly, thanks! |
Hi there, I am using the beta version of Webpack and it is not working. Has anyone had success using this with Webpack?
The text was updated successfully, but these errors were encountered: