cgk-rooster-streamen/webpack.config.js

52 lines
1.5 KiB
JavaScript

const Encore = require('@symfony/webpack-encore');
Encore
// Directory where compiled assets will be stored
.setOutputPath('public/build/')
// Public path used by the web server to access the output path
.setPublicPath('/build')
// Only needed for CDN's or subdirectory deploy
//.setManifestKeyPrefix('build/')
/*
* ENTRY CONFIG
* Each entry will result in one JavaScript file (and one CSS file if your CSS is imported into JavaScript)
*/
.addEntry('app', './assets/app.js')
.addEntry('roster', './assets/roster.js')
// When enabled, Webpack "splits" your files into smaller pieces for greater optimization.
.splitEntryChunks()
// Will require an extra script tag for runtime.js but, you probably want this, for better caching
.enableSingleRuntimeChunk()
// Enables SourceMaps at dev time
.enableSourceMaps(!Encore.isProduction())
// Enables hashed filenames (e.g. app.abc123.css)
.enableVersioning(Encore.isProduction())
// Enables @babel/preset-env polyfills
.configureBabelPresetEnv((config) => {
config.useBuiltIns = 'usage';
config.corejs = 3;
})
// Enables Vue.js support
//.enableVueLoader()
// Enables Sass/SCSS support
//.enableSassLoader()
// Uncomment if you use TypeScript
//.enableTypeScriptLoader()
// Uncomment if you want to use React
//.enableReactPreset()
// Enables PostCSS support
.enablePostCssLoader()
;
module.exports = Encore.getWebpackConfig();