webpack只替换库中的一个文件(bootstrap)

Ale*_*mov 7 webpack

在项目中使用角度2 + webpack + bootstrap

我想使用自定义的主题为自举-替换node_modules /../ bootstrap.css./Content/bootstrap.min.css

我为此添加了别名

alias: {
            'bootstrap/dist/css/bootstrap.css': './Content/bootstrap.min.css',
        }
Run Code Online (Sandbox Code Playgroud)

但有错误

Can't resolve '../fonts/glyphicons-halflings-regular.eot' in '\Content'
 @ ./Content/bootstrap.min.css
Run Code Online (Sandbox Code Playgroud)

如何替换文件但不更改依赖资源的文件夹

glyphicons-halflings-regular.eot必须在\node_modules中搜索,不是在Content中搜索

sci*_*per 1

也许另一个别名说:

'./Content/fonts': 'node_modules/bootstrap/dist/fonts'
Run Code Online (Sandbox Code Playgroud)

看起来有点老套,但也许可以尝试一下。