-
Notifications
You must be signed in to change notification settings - Fork 18
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
Image path dev vs production build directory #72
Comments
Hmm, I'll have to think about that. |
So i'm not sure if it's the most elegant approach but i used string replacement (a solutions i used with gulp in the past) as a workaround. Using this webpack module: and i added the following after the config.module block (in the webpack.config.js): if(ENV === 'build') {
config.module.loaders.push(
{
test: /\.(html|scss)$/,
loader: StringReplacePlugin.replace({
replacements: [
{
pattern: /src="\.\/img\//ig,
replacement: function (match, p1, offset, string) {
return 'src="/angular/dist/img/';
}
},
{
pattern: /url\('\.\/img\//ig,
replacement: function (match, p1, offset, string) {
return "url('/angular/dist/img/";
}
}
]})
}
);
} |
@henry-martinez would you be interested in doing a PR? |
@cmelion unfortunately i'm up to my neck with projects and wouldn't be able to find the time anytime soon. |
Hi I'm still getting used to webpack and the workflow so I'm not sure if it's an issue or if i'm going about it the wrong way.
I'd like to have a dev image path url and a different url path when i go to build for the production server.
For example:
While DEV'ing (npm start):
and
BUILD (npm run build):
Now, i've successfully updated the publicPath to properly build the css and js paths:
Unfortunately my image paths remain the same when i go to build so they don't display.
Am I missing something here?
Thanks, for any help.
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/37383336-image-path-dev-vs-production-build-directory?utm_campaign=plugin&utm_content=tracker%2F32095848&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F32095848&utm_medium=issues&utm_source=github).The text was updated successfully, but these errors were encountered: