Comments (7)
π
from style-loader.
omg... this is pretty weird... :-O
from style-loader.
in server/bundle.js
you are starting the compiler twice:
var compiler = webpack(webpackConfig, function () {
console.log('Project is ready!');
}); // starts a compilation
var bundler = new WebpackDevServer(compiler, {
// ...
}); // starts watching, which also starts a compilation
to fix it:
var compiler = webpack(webpackConfig); // only create a compiler
var bundler = new WebpackDevServer(compiler, {
// ...
}); // starts watching, which starts the compilation
from style-loader.
I propably need to throw an error in this case.
from style-loader.
Hehe, thanks for taking a look @sokra and yeah and error there would be good. Though I think a more common pattern using the webpack instance would be:
var compile = webpack(webpackConfig);
compile(function () {
console.log('compiled');
});
And:
var compile = webpack(webpackConfig);
var bundler = new WebpackDevServer(compile, {
});
// First compile running
But I suppose that is too big of a change, and maybe does not make sense related to the rest of the API. But I do seem to loose a hook to check when the initial bundle is ready? Maybe add a callback to the webpack dev server?
var compiler = webpack(webpackConfig);
var bundler = new WebpackDevServer(compiler, {}, function () {
// Initial compile done
});
// Starts compilation
from style-loader.
Ah, I can see there is a plugin mechanism?
var compiler = webpack(webpackConfig);
compiler.plugin('done', function () {
console.log('Compile done');
});
var bundler = new WebpackDevServer(compiler, {});
// Starts compilation
No problems using that?
from style-loader.
Closing since it looks like it's been fixed.
from style-loader.
Related Issues (20)
- Appropriate loader handler for specific file only. HOT 2
- TypeError: this.getOptions is not a function HOT 19
- Style-loader duplicates insert function HOT 3
- HMR does not work with webpack 5 HOT 3
- Changes to `insert` module file do not trigger cache invalidation HOT 4
- i can't download the module HOT 1
- HMR does not work HOT 1
- What style-loaders expects as input? HOT 5
- Is there a injectType=lazyStyleTag .use() & .unuse() equivalent when using css-loader + mini-css-extract-plugin HOT 11
- Add support for using lazyStyleTag use() from a JavaScript module (injecting into multiple shadow DOMs) HOT 21
- why style-loader is pitch loaderοΌ HOT 2
- Support asset-modules instead of file-loader HOT 3
- Webpack "lazyStyleTag" configuration won't copy fonts after upgrade to Angular 13 HOT 18
- Noop in environment without DOM api HOT 1
- Can not export selectors from `@import url(...)` HOT 2
- Get CSS properties / variables from JavaScript HOT 3
- Vulnerable dependencies (indirect security issues) HOT 1
- webpack 5 is returning a object instead URL HOT 2
- Promotion of unsafe code HOT 1
- Excessive whitespace and line breaks in code generated by style-loader HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from style-loader.