Skip to content
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

Using assets package with webpack 4 and babel7 #280

Open
kure- opened this issue May 29, 2018 · 1 comment
Open

Using assets package with webpack 4 and babel7 #280

kure- opened this issue May 29, 2018 · 1 comment

Comments

@kure-
Copy link

kure- commented May 29, 2018

Hey,
this is probably not a real issue, but I would like to share this case if anyone struggles with the same problem.
I'm using webpack 4.9.1 in my project with latest babel7 and I've run into an issue with Assets package while using file() in combination with match() when using 1.0.0 of webpack blocks. The package uses probably outdated version of file-loader dependency (0.11.2). Forcing resolutions in my package.json to use latest version of file-loader (1.11.1) removed an issue Cannot read property 'fileLoader' of undefined with setup like that:

const { createConfig, match } = require('@webpack-blocks/webpack');
const { css, url, file } = require('@webpack-blocks/assets');
const babel = require('@webpack-blocks/babel');
....
....
createConfig([
		babel(),
		match(['*.css'], [
			css()
		]),
		match(['*.svg'], [
			file()
		]),
	])
...

The case is, that you load a CSS file, which contains classes that have property e.g. background-image:url(../icons/checkmark.svg. Without the match() and file() it cant handle such files as the webpack tries to handle the source of the svg itself.

@andywer
Copy link
Owner

andywer commented Jun 30, 2018

Ohh, that issue is still unanswered. Sorry for that!

Try the v2.0.0-alpha with webpack 4 support 😉

Install using npm install --save-dev webpack-blocks@next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants