-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
webpack 4.0.0-alpha.3/4 feedback #6244
Comments
Hm.. why not |
I like |
I agree with @donaldpipowitch, and having |
Precisely what @donaldpipowitch said. This is our opportunity to use a pretty common pattern as a default. |
I would question not inspecting the package.json |
Just following up on #6179 (comment): there was indeed a second Webpack instance installed, by Now I'm seeing some issues with JSON in production. Without using a JSON loader, the file attaches itself to urHsdkTj: function(e) {
e.exports = {
white: "#ffffff",
black: "#000000", ...but when I import it the code looks for , Z = n("urHsdkTj")
, Q = K()(Z.default.gray[9]).alpha(.2).css() Doesn't appear to be an issue in development mode, where var UMBRA_COLOR = chroma_js__WEBPACK_IMPORTED_MODULE_3___default()(open_color_open_color_json__WEBPACK_IMPORTED_MODULE_4__.gray[9]).alpha(0.2).css(); |
@phyllisstein There is a bugfix for JSON modules in concatenated modules in 4.0.0-alpha.4. This probably fixes your issue. |
@michael-ciniawsky Does it happen since |
~~@ooflorent Affects all The issue was on my side, all good :D // HACK
this._module.type = 'text/css' // don't do that :) 😅 🙃 |
hmm weird. What's the configuration? |
yeah... don't do that... |
Can't wait to try out webpack 4! |
@sokra Sure does! Thanks for being on top of all this, super excited for the new version. |
+1 on defaults! 🔮🌠 |
Just to expand on my point above and to echo @probablyup's comment. If webpack defaults to
This is nice because it's very similar to how Having said all this, webpack config is still there! You can point it to whatever you need to anyway. |
@KidkArolis That's actually a good point if package.json references will be considered. |
That's already how webpack works, if you point entry config to a dir with |
I noticed that UglifyJS is loaded automatically as part of the option defaults: webpack/lib/WebpackOptionsDefaulter.js Lines 172 to 182 in 37cc6f4
What happens when users want to add a different version or different options? |
@filipesilva You can just override the option: const MinifyPlugin = require("babel-minify-webpack-plugin");
module.exports = {
optimization: {
minimizer: [
new MinifyPlugin(minifyOpts, pluginOpts)
]
}
} The same way you can add additional minimizer i. e. for CSS. |
Coolio, did not know that 👍 |
@sokra RE: overriding options, could you please give a few more examples? My concern is overriding an array versus extending it (adding additional minimizer). And please put the name of the file which you show a snippet from, it's never too verbose when giving examples which stay on the Internet and show up in Google results. Thank you. |
Just out of curiosity, is there a checklist, or a "definition of done" for this alpha stage? All I've seen is these feedback issues. Basically, what is required before v4 moves to beta? No rush, I'd just like a better idea of a timeline if there is one. |
@probablyup I expect the package.json |
@jchitel we are very close for alpha => beta, but we've been trying to keep as much feature work (as possible) in alpha. This way, we can purely focus on stabilization for beta=>RC, etc We are overdue on a list but currently its a bit nebulous at the moment. The large ticket items are complete right now and we've been focusing on UX/Defaults/Build Perf small items at the moment. |
@TheLarkInn How about this feature, is it feasible? #5433 |
from entry ./src to output.path ./dist |
Hey all, I'm just turning my attention to trying out
Presently erroring out with:
Linking back to the migration guide you provided for |
It looks like you added a custom hook for your plugin. Since the new plugin system adhoc hooks are no longer possible, instead each hook must be registered before being able to call it. To register your hook add the hook to const AsyncSeriesHook = require("tapable").AsyncSeriesHook;
compiler.hooks.forkTsCheckerServiceBeforeStart = new AsyncSeriesHook([]); You can call the hook with: compiler.hooks.forkTsCheckerServiceBeforeStart.callAsync(function() {...})
// or
promise = compiler.hooks.forkTsCheckerServiceBeforeStart.callPromise() To make back-compat layer work for your hook: compiler._pluginCompat.tap("ForkTsCheckerPlugin", options => {
if(options.name === 'fork-ts-checker-service-before-start')
options.async = true;
}); Hook is automatically mapped to the camelCased variant. If you don't want this, you can modify the compat layer in the |
Thanks @sokra - I'll take a look and report back! |
I think that the changes that the html-webpack-plugin is making for webpack 4 probably illustrate what you're advising @sokra. Specificially the changes to https://github.com/jantimon/html-webpack-plugin/pull/823/files#diff-168726dbe96b3ce427e7fedce31bb0bc Might see if I can use that as a basis. Looks like @Graham42 is using cc @piotr-oles - relevant for TypeStrong/fork-ts-checker-webpack-plugin#78 |
I've been taking a look at getting ts-loader to support webpack 4. You can see what I've done here: Here's a Travis build that illustrates issues: https://travis-ci.org/TypeStrong/ts-loader/jobs/328741003 Unfortunately I'm getting a rather cryptic error when I try to run most of the tests:
My guess is that this is something to do with the changes here:
They look fine to me; can anyone offer any thoughts on this? There doesn't seem to be a simple way to diagnose this.... |
- loader._compiler.hooks.watchRun.tapAsync("ts-loader"), makeWatchRun(instance);
+ loader._compiler.hooks.watchRun.tapAsync("ts-loader", makeWatchRun(instance)); |
Lemme try |
for both hooks |
Done - now ts-loader hangs :-(
and then nothing... |
I call this Progress... |
😄 I've just committed - it's still just hanging though. Should make Travis hang too now 😉 Yup: https://travis-ci.org/TypeStrong/ts-loader/jobs/328747818 |
Yeah I'm wondering if there's something wrong with
|
Okay - got some sleep and tried something else. The I'll do some more digging but it looks like calling
All I did wonder if Can anyone advise on why adding extra errors to the |
compilation.errors is still an Array. |
Yup - just did the Any ideas on how I could on why adding extra errors to the |
Hey @sokra, Just wondering if you've any ideas on how I could on why adding extra errors to the Much ❤️ |
Next alpha version: #6357 |
Thanks for all the feedback |
4.0.0-alpha.0
4.0.0-alpha.1
4.0.0-alpha.2
Features
entry
defaults to./src
output.path
defaults to./dist
output.globalObject
config option to allow to choose the global object reference in runtime exitCodeWatching.invalidate
production
defaults when omiting themode
optionthis.hot
flag to loader context when HMR is enabledBugfixes
process.exit
and useprocess.exitCode
insteadwebpack/hot/signal
-!
behavior with post loadersrun
andwatchRun
hooks forMultiCompiler
Internal changes
buildMeta.harmony
has been replaced withbuildMeta.exportsType: "namespace
buildMeta.exportsType: "default"
for json modulesPlease comment if you find additional changes not in the changelog
The text was updated successfully, but these errors were encountered: