webpack-encore

Webpack (Encore): convert images to webp using image-webpack-loader

ぃ、小莉子 提交于 2019-12-20 03:14:49
问题 I am trying to convert my jpeg images to the webp format using the image-webpack-loader plugin in Webpack Encore. The following config successfully minifies my files but does not convert them to webp images. webpack.config.js test: /\.(gif|png|jpe?g|svg)$/i, loader: 'image-webpack-loader', options: { disable: true, //bypassOnDebug convertPathData: false, mozjpeg: { //works progressive: true, quality: '80-90' }, webp: { //doesn't convert my images to webp quality: 75, enabled: true } } How can

Encore, Vue, Eslint - Use the latest vue-eslint-parser

丶灬走出姿态 提交于 2019-12-13 04:12:35
问题 Hi guys I'm having an issue with vue-eslint-parser. I'm trying to run it on Encore /var/app/assets/js/app.js 1:1 error Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error vue/valid-v-pre 1:1 error Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error vue/no-duplicate-attributes 1:1 error Use the latest vue-eslint-parser. See

Webpack error from UglifyJS when creating production assets

不羁岁月 提交于 2019-12-11 16:47:05
问题 I am using Webpack Encore (similar to Webpack) to create asset files. Everything works well when creating the development files, however when running to command to generate the minified files for production I get an error. ERROR Failed to compile with 1 errors app.js from UglifyJS . Invalid assignment [app.js:131,42] Unexpected character '`' [app.js:10953,9] It seems like the issue is caused by two plugins: jquery-asScrollable and jquery-asScrollbar In fact commenting out the following lines,

Symfony 4 / Webpack Encore : jQuery doesn't work

笑着哭i 提交于 2019-12-10 14:54:19
问题 jQuery doesn't work and I can't use my bootstrap dropdown, custom javascript... After a npm run dev (or npm run build ), app.js file is well created and loads in the browser. Compilation is done without any error. I tried to enable .autoProvidejQuery() then npm run dev / npm run build , but nothing changes. I am using Symfony 4.1.6 Solution found Change .enableSingleRuntimeChunk() to .disableSingleRuntimeChunk() in webpack.config.js If you just comment on the line, it works but you have a

Symfony 4 webpack + encore handle image in template

橙三吉。 提交于 2019-12-10 11:25:59
问题 Using Symfony 4 with Webpack + Encore + Yarn, I want to handle images in my templates, and I am not really how to achieve this. I put my image in my /assets/img/logo.png folder, and use this in my webpack.config.js : .addEntry('logo', './assets/img/logo.png') And after I run : yarn run encore dev Which generates /public/build/logo.js and /public/build/images/logo.aez323a.png files. My question, is there a way to link Symfony asset() function to the file name with the hash in the filename ? or

Webpack Encore - jQuery plugins out of view

梦想的初衷 提交于 2019-12-06 15:02:29
I'm trying to use SensioLab Webpack Encore in my Symfony 3.3 project, but after adding few scripts to webpack, my script doesn't see functions of other scripts. package.json { "name": "HIDDEN", "version": "1.0.0", "license": "UNLICENSED", "description": "HIDDEN", "repository": { "url": "HIDDEN", "type": "git" }, "author": "Alexey Samara <HIDDEN>", "dependencies": { "jquery": "3.1.1", "expose-loader": "0.7.3", "bootstrap": "3.3.7", "datatables.net": "1.10.15", "datatables.net-buttons": "1.4.0", "datatables.net-buttons-bs": "1.4.0", "html5shiv": "^3.7.3", "respond.js": "^1.4.2", "metismenu": "2

Webpack Encore - $ is not defined

落爺英雄遲暮 提交于 2019-12-06 06:33:02
问题 I followed the documentation to make Webpack Encore work in my project. Imported js files in webpack.config.js work fine but I have an issue in page-specific js : $ is not defined . Webpack.config.js : const Encore = require('@symfony/webpack-encore'); var webpack = require('webpack'); Encore .setOutputPath('public/build/') .setPublicPath('http://localhost/tharmo/public/build') .setManifestKeyPrefix('build/') .cleanupOutputBeforeBuild() .enableSourceMaps(!Encore.isProduction())

Webpack Encore - $ is not defined

柔情痞子 提交于 2019-12-04 14:12:20
I followed the documentation to make Webpack Encore work in my project. Imported js files in webpack.config.js work fine but I have an issue in page-specific js : $ is not defined . Webpack.config.js : const Encore = require('@symfony/webpack-encore'); var webpack = require('webpack'); Encore .setOutputPath('public/build/') .setPublicPath('http://localhost/tharmo/public/build') .setManifestKeyPrefix('build/') .cleanupOutputBeforeBuild() .enableSourceMaps(!Encore.isProduction()) .autoProvidejQuery() .createSharedEntry('vendor', [ './assets/js/custom.js', 'materialize-css', ]) .addEntry('app', '

Webpack (Encore): convert images to webp using image-webpack-loader

谁说我不能喝 提交于 2019-12-02 02:20:35
I am trying to convert my jpeg images to the webp format using the image-webpack-loader plugin in Webpack Encore. The following config successfully minifies my files but does not convert them to webp images. webpack.config.js test: /\.(gif|png|jpe?g|svg)$/i, loader: 'image-webpack-loader', options: { disable: true, //bypassOnDebug convertPathData: false, mozjpeg: { //works progressive: true, quality: '80-90' }, webp: { //doesn't convert my images to webp quality: 75, enabled: true } } How can I achieve what I want using the plugin image-webpack-loader ? Or is there another plugin I should use