-
Notifications
You must be signed in to change notification settings - Fork 305
Unable to use url-loader or file-loader #914
Comments
ignore point 8 - it seems to me know that behaveiour is not deterministic. Sometimes i can see that everything is fine, next time I don't see emited file in build directory. |
We have the same problem using v1.3.4. The file-loader doesn't emit the file. If we console.log the We tried point 8 like indicated by @bunny1985 and now files loaded through file-loader are there. |
Same here |
The following line is responsible for limiting webpack to output only certain files: https://github.com/ionic-team/ionic-app-scripts/blob/master/src/webpack.ts#L116 I think any file starting with the build directory should be outputted, not only .js and .js.map. |
I noticed that there are tests preventing css files to be written to the build dir so I guess the proper way to resolve this would be to replace: return dirname(file.path).indexOf(context.buildDir) >= 0 && (file.path.endsWith('.js') || file.path.endsWith('.js.map')); with: return dirname(file.path).indexOf(context.buildDir) >= 0 && !file.path.endsWith('.css') && !file.path.endsWith('.css.map'); Is this acceptable? Personally I would like to use the file-loader to output files into the assets directory, so I would perfer to filter on With these changes using the file-loader will still fail when targeting a non existing subfolder e.g. 'assets/i18n' because Can we get an update on this? If necessary I would be happy to provide a pull request for this after some feedback. Note: I don't know if this will resolve any url-loader issues. |
Can you try
It should just work in theory. Thanks, |
Nightly works perfect, thanks! |
Short description of the problem:
Files included with url-loader does not appear in "build" folder
What behavior are you expecting?
Files "required" with url-loader/file-loader should be emited to build directory.
Steps to reproduce:
Add following:
declare function require(string: string): string;
this.t = require("file-loader?name=[name].[ext]&limit=0!./bg.jpg");
run once again and see the result
Which @ionic/app-scripts version are you using?
@ionic/app-scripts": "1.3.0
The text was updated successfully, but these errors were encountered: