javascript - Module not found: Error: Can't resolve 'filepath', but the file certainly exists -


i have .js file requires .svg file:

// ...  '.icon': {    filter: `url(${require('./svg_filters/filters.svg')})` },  // ... 

i've checked , double-checked file 'svg_filters/filters.svg' exists , in right location relative .js file.

i've made sure webpack.config.js configured pack .svg files:

// ...  module: {   loaders: [     // ...     {       test: /\.svg$/, loader: 'file'     }   ] }  // ... 

but when try run webpack, error (edited scrub actual project's filenames):

error in ./my/script.js module not found: error: can't resolve './svg_filters/filters.svg' in '/home/kevin/programming/project/src/my'  @ ./src/my/script.js xx:27-63 

why getting error? there else need set before webpack can bundle .svg files?


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -