In project used angular 2 + webpack + bootstrap
I want use custom theme for bootstrap - replace node_modules/../bootstrap.css with ./Content/bootstrap.min.css
I add alias for that
alias: {
'bootstrap/dist/css/bootstrap.css': './Content/bootstrap.min.css',
}
but have errors
Can't resolve '../fonts/glyphicons-halflings-regular.eot' in '\Content' @ ./Content/bootstrap.min.css
How I can replace a file but not change the folder for depend resources
example
glyphicons-halflings-regular.eot must be searched in \node_modules not in Content
Maybe another alias that says:
'./Content/fonts': 'node_modules/bootstrap/dist/fonts'
Seems a bit hacky, but maybe give it a try.
You can use CopyWebpackPlugin to load css,js file.Try this code
npm install copy-webpack-plugin --save-dev
resolve: {
extensions: ['.ts', '.js'],
alias: {
Content$: path.resolve(__dirname, './Content'),
}
},
plugins: [
new CopyWebpackPlugin([
{ from: 'bootstrap/dist/css/bootstrap.css', to: './Content' }
])
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With