Category : webpack

I am working on a Symfony project using Webpack & Datatables. After a large update of my dependencies to latest versions, i get the following error when compiling with Webpack: "./node_modules/datatables.net/js/jquery.dataTables.js" contains a reference to the file "define". This file can not be found, please check it for typos or update it if the file ..

Read more

i configured webpack to create my bundle vue files. These files are located in mybundle/src/Resources/public/build/ my webpack output path looks like this: Encore .setOutputPath(‘src/Resources/public/build/’) .setPublicPath(‘/build/’) .addEntry(‘einsatz’, ‘./assets/vue/views/einsatz/index.js’) Now the twig function {{ encore_entry_script_tags(‘einsatz’) }} results in an error because this entry doesnt exists in the main App entrypoints.json. How i can tell twig to look ..

Read more

I have a project based on on symfony 5 and webpack-encore. I run multiple instances of the project in production, with different contents. I create a docker image and run many containers off the same image, setting the content via ENV variables that typically configure the database name. No .env.* files involved, just RAM-based ENV ..

Read more

I’m having trouble setting up TailwindCSS with Symfony and I’m not sure what’s wrong webpack.config.js var Encore = require(‘@symfony/webpack-encore’); if (!Encore.isRuntimeEnvironmentConfigured()) { Encore.configureRuntimeEnvironment(process.env.NODE_ENV || ‘dev’); } Encore .setOutputPath(‘public/build/’) .setPublicPath(‘/build’) .addStyleEntry(‘tailwind’, ‘./assets/css/tailwind.css’) .enablePostCssLoader((options) => { options.config = { // directory where the postcss.config.js file is stored path: ‘./postcss.config.js’ }; }) .splitEntryChunks() .enableSingleRuntimeChunk() .cleanupOutputBeforeBuild() .enableBuildNotifications() .enableSourceMaps(!Encore.isProduction()) .enableVersioning(Encore.isProduction()) ..

Read more

I have something like this in JS file: const icon = require(‘path-to.svg’).default; div.innerHTML = icon; When I build my assets using default Webpack 5.6.0 with rule test: /.(svg)$/, loader: ‘raw-loader’ the result is awesome: <div><svg>…</svg></div> But when I use Symfony Webpack Encore (latest) with (and without too) rule, the result is: <div>path-to.svg</div> Only file name! ..

Read more

I cannot compile my resources with the command yarn encore dev I have this error, it can’t find the variable $primary and the others, while I import in the app.js file / Voici un extrait de mon fichier app.js : import ‘./styles/app.css’; import ‘./styles/_variables.scss’; import ‘./styles/_bootswatch.scss’; import ‘./styles/bootstrap.css’; import ‘./styles/bootstrap.min.css’; et mon architecture de fichiers ..

Read more