-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Question: bug with style-loader? #375
Comments
I'm also experiencing this issue... |
I am experiencing this issue with fonts that are loaded in the public folder. They are visible on localhost:5000 but on localhost:3000 the fonts show for a fraction of a second and then the styles and the fonts disappear. |
I just specified the publicPath for the client to work around this. I believe it only shows up in dev mode. const clientConfig = merge({}, config, {
entry: [
...(WATCH ? ['webpack-hot-middleware/client'] : []),
'./src/client.js',
],
output: {
path: path.join(__dirname, '../build/public'),
// need to give absolute URL when using sourcemaps/blobs
// https://github.com/webpack/css-loader/issues/29
// https://github.com/webpack/style-loader/issues/55
publicPath: DEBUG ? 'http://localhost:3000/': '/',
filename: DEBUG ? '[name].js?[hash]' : '[name].[hash].js',
}, |
@nss213 thanks, this also works |
@nss213 Worked for me : const clientConfig = merge({}, config, {
entry: './src/client.js',
output: {
path: path.join(__dirname, '../build/public'),
publicPath: DEBUG ? 'http://localhost:3000/' : '/',
filename: DEBUG ? '[name].js?[hash]' : '[name].[hash].js',
}, |
@arao456 no, browsersync works fine. But you can try change url-loader to
|
@Bogdaan that seems to work for me. What also works is setting publicPath to |
@arao456 yes, of course if you devices are connected via a network - you need external address |
@Bogdaan I realize this now, but I guess the point I'm getting at is that the fix using |
- Allows to import external css from node_modules (ref kriasoft#510, kriasoft#824) - Allows to properly process `url()` statements (ref kriasoft#825) - Allows to import css without css-modules prefixing (close kriasoft#771) ```css /* Example: MyTextEditorComponent.css */ :global { @import 'draft-js/dist/Draft.css'; /* external style without prefixing */ } .button { color: red; } /* keep the prefixes for your own style */ ``` Also closes kriasoft#375 and kriasoft#423
- Allows to import external css from node_modules (ref #510, #824) - Allows to properly process `url()` statements (ref #825) - Allows to import css without css-modules prefixing (close #771) ```css /* Example: MyTextEditorComponent.css */ :global { @import 'draft-js/dist/Draft.css'; /* external style without prefixing */ } .button { color: red; } /* keep the prefixes for your own style */ ``` Also closes #375 and #423
When i work with css background-image source map generate "Blob" url, and images not loaded from dev-server:
In style-loader i found this note: output.publicPath
It posible load image from files with current webpack config (with publicPath=/)?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: