issues 139
Thx @timneutkens but it not works ... no woff file in .next directory
To clarify : it's an external stylesheets, ie. the css file, woff and images are in a node_module.
The css file references assets using a relative path :
@font-face{font-family:"Avenir";font-weight:200;src:url("./fonts/avenir-lighter.woff")
I think that the imports and url(...)s in the CSS are not resolve with the CSS loader.
css loader does not resolve imports. So it's up to you to implement it. In the other issue I meant you could take next-images as an example to implement your own.
Adding loaders for fonts etc is out of scope for next-css / sass / less, they just implement the corresponding webpack loader.
Ok, thanks.
I finally discover that with that small configuration :
module.exports = withCss({
cssModules: false,
webpack(config, options) {
config.module.rules.push({
test: /\.css$/,
use: ['css-loader'],
include: ['node_modules/my-styleguide']
}, {
test: /\.(png|woff|woff2|eot|ttf|svg|gif|jpg)$/,
loader: 'file-loader',
options: {
publicPath: '/_next/static/',
outputPath: "static/"
}
});
return config;
}
});
the font-files are successfully created into the folder '/_next/static/' but they disappear instantly.
Have you any idea of the cause of that please ?
Ah, i found : https://github.com/zeit/next.js/pull/4015
So pass to 5.1.0 and it works !!!
Most helpful comment
Ok, thanks.
I finally discover that with that small configuration :
the font-files are successfully created into the folder '/_next/static/' but they disappear instantly.
Have you any idea of the cause of that please ?