const Encore = require('@symfony/webpack-encore') const path = require('path') //const ManifestPlugin = require('webpack-manifest-plugin') if (!Encore.isRuntimeEnvironmentConfigured()) { Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev') } Encore .setOutputPath('public/build/') .setPublicPath('/build') .copyFiles({ from: './assets/images', to: 'images/[path][name].[ext]' }) .addEntry('app', './assets/js/index.js') .splitEntryChunks() // will require an extra script tag for runtime.js // but, you probably want this, unless you're building a single-page app .enableSingleRuntimeChunk() .cleanupOutputBeforeBuild() .enableBuildNotifications() .enableSourceMaps(!Encore.isProduction()) .enableVersioning(Encore.isProduction()) .configureBabel((config) => { config.plugins.push('@babel/plugin-proposal-class-properties') }) // enables @babel/preset-env polyfills .configureBabelPresetEnv((config) => { config.useBuiltIns = 'usage' config.corejs = 3 }) .addAliases({ '@': path.resolve(__dirname, 'assets', 'js'), styles: path.resolve(__dirname, 'assets', 'styles') }) .enableSassLoader() .enableVueLoader(() => {}, { runtimeCompilerBuild: false }) .enableTypeScriptLoader() .autoProvidejQuery() module.exports = Encore.getWebpackConfig()