Аналогично, пример подключения bootstrap:
assets/dashboard/js/dashboard.js
var $ = require('jquery');
require('bootstrap');
assets/dashboard/scss/dashboard.scss
@import "~bootstrap/scss/bootstrap";
webpack.config.js
var Encore = require('@symfony/webpack-encore');
Encore
.setOutputPath('public/assets/')
.setPublicPath('/assets')
.cleanupOutputBeforeBuild()
.enableSourceMaps(!Encore.isProduction())
.addEntry('js/dashboard', './assets/dashboard/js/dashboard.js')
.addStyleEntry('css/dashboard', './assets/dashboard/scss/dashboard.scss')
.enableSassLoader(function(sassOptions) {}, {
resolveUrlLoader: false
})
.autoProvidejQuery()
;
module.exports = Encore.getWebpackConfig();