Set up Webpack Encore
This commit is contained in:
parent
f97988b02e
commit
e1bef7c01f
38 changed files with 14937 additions and 1202 deletions
43
webpack.config.js
Normal file
43
webpack.config.js
Normal file
|
@ -0,0 +1,43 @@
|
|||
const Encore = require('@symfony/webpack-encore');
|
||||
|
||||
if (!Encore.isRuntimeEnvironmentConfigured()) {
|
||||
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
|
||||
}
|
||||
|
||||
Encore
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// PATHS
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
.setOutputPath('public/assets/build/')
|
||||
.setPublicPath('/assets/build')
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// ENTRIES
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
.addEntry('app', './public/assets/js/app.js')
|
||||
.addStyleEntry('main', './public/assets/css/main.scss')
|
||||
.addStyleEntry('panel', './public/assets/css/panel.scss')
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// FEATURES
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
.disableSingleRuntimeChunk()
|
||||
.cleanupOutputBeforeBuild()
|
||||
.enableBuildNotifications()
|
||||
.enableSourceMaps(!Encore.isProduction())
|
||||
.configureBabel((config) => {
|
||||
config.plugins.push('@babel/plugin-proposal-class-properties');
|
||||
})
|
||||
.configureBabelPresetEnv((config) => {
|
||||
config.useBuiltIns = 'usage';
|
||||
config.corejs = 3;
|
||||
})
|
||||
.enableSassLoader()
|
||||
.enablePostCssLoader()
|
||||
;
|
||||
|
||||
module.exports = Encore.getWebpackConfig();
|
Loading…
Add table
Add a link
Reference in a new issue