From b2980dae8242d1d668e3d8bf7d34a1d1ef774840 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 3 Jul 2017 17:18:37 +0200 Subject: [PATCH 1/5] Added a recipe for Webpack Encore --- symfony/webpack-encore/0.9/assets/.gitignore | 0 symfony/webpack-encore/0.9/manifest.json | 8 +++++++ symfony/webpack-encore/0.9/package.json | 11 ++++++++++ symfony/webpack-encore/0.9/webpack.config.js | 23 ++++++++++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 symfony/webpack-encore/0.9/assets/.gitignore create mode 100644 symfony/webpack-encore/0.9/manifest.json create mode 100644 symfony/webpack-encore/0.9/package.json create mode 100644 symfony/webpack-encore/0.9/webpack.config.js diff --git a/symfony/webpack-encore/0.9/assets/.gitignore b/symfony/webpack-encore/0.9/assets/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/symfony/webpack-encore/0.9/manifest.json b/symfony/webpack-encore/0.9/manifest.json new file mode 100644 index 00000000..3ef80ee1 --- /dev/null +++ b/symfony/webpack-encore/0.9/manifest.json @@ -0,0 +1,8 @@ +{ + "copy-from-recipe": { + "assets/": "%PROJECT_DIR%/", + "package.json": "%PROJECT_DIR%/", + "webpack.config.js": "%PROJECT_DIR%/" + }, + "aliases": ["encore", "webpack", "webpack-encore"] +} diff --git a/symfony/webpack-encore/0.9/package.json b/symfony/webpack-encore/0.9/package.json new file mode 100644 index 00000000..c60447b1 --- /dev/null +++ b/symfony/webpack-encore/0.9/package.json @@ -0,0 +1,11 @@ +{ + "devDependencies": { + "@symfony/webpack-encore": "^0.9.1" + }, + "scripts": { + "dev-server": "./node_modules/.bin/encore dev-server", + "dev": "./node_modules/.bin/encore dev", + "watch": "./node_modules/.bin/encore dev --watch", + "build": "./node_modules/.bin/encore production" + } +} diff --git a/symfony/webpack-encore/0.9/webpack.config.js b/symfony/webpack-encore/0.9/webpack.config.js new file mode 100644 index 00000000..dced1172 --- /dev/null +++ b/symfony/webpack-encore/0.9/webpack.config.js @@ -0,0 +1,23 @@ +var Encore = require('@symfony/webpack-encore'); + +Encore + // directory where all compiled assets will be stored + .setOutputPath('web/build/') + // what's the public path to this directory (relative to your project's document root dir) + .setPublicPath('/build') + // empty the outputPath dir before each build + .cleanupOutputBeforeBuild() + // allow sass/scss files to be processed + .enableSassLoader() + .enableSourceMaps(!Encore.isProduction()) + // will output as web/build/app.js + // .addEntry('app', './assets/js/app.js') + // will output as web/build/global.css + // .addStyleEntry('global', './assets/css/app.scss') + // allow legacy applications to use $/jQuery as a global variable + // .autoProvidejQuery() + // create hashed filenames (e.g. app.abc123.css) + // .enableVersioning() +; + +module.exports = Encore.getWebpackConfig(); From 65a9789d7c499596b57930ceafc3541d745ea6b5 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 3 Jul 2017 17:21:10 +0200 Subject: [PATCH 2/5] Use 4 space indentation --- symfony/webpack-encore/0.9/package.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/symfony/webpack-encore/0.9/package.json b/symfony/webpack-encore/0.9/package.json index c60447b1..c1f3a5ae 100644 --- a/symfony/webpack-encore/0.9/package.json +++ b/symfony/webpack-encore/0.9/package.json @@ -1,11 +1,11 @@ { - "devDependencies": { - "@symfony/webpack-encore": "^0.9.1" - }, - "scripts": { - "dev-server": "./node_modules/.bin/encore dev-server", - "dev": "./node_modules/.bin/encore dev", - "watch": "./node_modules/.bin/encore dev --watch", - "build": "./node_modules/.bin/encore production" - } + "devDependencies": { + "@symfony/webpack-encore": "^0.9.1" + }, + "scripts": { + "dev-server": "./node_modules/.bin/encore dev-server", + "dev": "./node_modules/.bin/encore dev", + "watch": "./node_modules/.bin/encore dev --watch", + "build": "./node_modules/.bin/encore production" + } } From 6795d7f360f3c84265debdae9ae8fe778502a8f2 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 21 Jul 2017 10:38:02 +0200 Subject: [PATCH 3/5] Fixes asked for by reviewers --- symfony/webpack-encore/0.9/package.json | 8 +++--- symfony/webpack-encore/0.9/webpack.config.js | 27 ++++++++++---------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/symfony/webpack-encore/0.9/package.json b/symfony/webpack-encore/0.9/package.json index c1f3a5ae..1f3a0936 100644 --- a/symfony/webpack-encore/0.9/package.json +++ b/symfony/webpack-encore/0.9/package.json @@ -3,9 +3,9 @@ "@symfony/webpack-encore": "^0.9.1" }, "scripts": { - "dev-server": "./node_modules/.bin/encore dev-server", - "dev": "./node_modules/.bin/encore dev", - "watch": "./node_modules/.bin/encore dev --watch", - "build": "./node_modules/.bin/encore production" + "dev-server": "encore dev-server", + "dev": "encore dev", + "watch": "encore dev --watch", + "build": "encore production" } } diff --git a/symfony/webpack-encore/0.9/webpack.config.js b/symfony/webpack-encore/0.9/webpack.config.js index dced1172..e36fa208 100644 --- a/symfony/webpack-encore/0.9/webpack.config.js +++ b/symfony/webpack-encore/0.9/webpack.config.js @@ -1,23 +1,24 @@ var Encore = require('@symfony/webpack-encore'); Encore - // directory where all compiled assets will be stored - .setOutputPath('web/build/') - // what's the public path to this directory (relative to your project's document root dir) + // the project directory where compiled assets will be stored + .setOutputPath('public/build/') + // the public path used by the web server to access the previous directory .setPublicPath('/build') - // empty the outputPath dir before each build .cleanupOutputBeforeBuild() - // allow sass/scss files to be processed - .enableSassLoader() .enableSourceMaps(!Encore.isProduction()) - // will output as web/build/app.js - // .addEntry('app', './assets/js/app.js') - // will output as web/build/global.css - // .addStyleEntry('global', './assets/css/app.scss') - // allow legacy applications to use $/jQuery as a global variable + // uncomment to create hashed filenames (e.g. app.abc123.css) + // .enableVersioning(Encore.isProduction()) + + // uncomment to define the assets of the project + // .addEntry('js/app', './assets/js/app.js') + // .addStyleEntry('css/app', './assets/css/app.scss') + + // uncomment if you use Sass/SCSS files + // .enableSassLoader() + + // uncomment for legacy applications that require $/jQuery as a global variable // .autoProvidejQuery() - // create hashed filenames (e.g. app.abc123.css) - // .enableVersioning() ; module.exports = Encore.getWebpackConfig(); From 95a2f42e1fca485317a8a857b41f31248b4071a3 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 2 Aug 2017 17:12:41 +0200 Subject: [PATCH 4/5] Make the recipe used webpack-encore-pack --- .../0.9 => webpack-encore-pack/1.0}/assets/.gitignore | 0 .../0.9 => webpack-encore-pack/1.0}/manifest.json | 0 .../0.9 => webpack-encore-pack/1.0}/package.json | 2 +- .../0.9 => webpack-encore-pack/1.0}/webpack.config.js | 0 4 files changed, 1 insertion(+), 1 deletion(-) rename symfony/{webpack-encore/0.9 => webpack-encore-pack/1.0}/assets/.gitignore (100%) rename symfony/{webpack-encore/0.9 => webpack-encore-pack/1.0}/manifest.json (100%) rename symfony/{webpack-encore/0.9 => webpack-encore-pack/1.0}/package.json (82%) rename symfony/{webpack-encore/0.9 => webpack-encore-pack/1.0}/webpack.config.js (100%) diff --git a/symfony/webpack-encore/0.9/assets/.gitignore b/symfony/webpack-encore-pack/1.0/assets/.gitignore similarity index 100% rename from symfony/webpack-encore/0.9/assets/.gitignore rename to symfony/webpack-encore-pack/1.0/assets/.gitignore diff --git a/symfony/webpack-encore/0.9/manifest.json b/symfony/webpack-encore-pack/1.0/manifest.json similarity index 100% rename from symfony/webpack-encore/0.9/manifest.json rename to symfony/webpack-encore-pack/1.0/manifest.json diff --git a/symfony/webpack-encore/0.9/package.json b/symfony/webpack-encore-pack/1.0/package.json similarity index 82% rename from symfony/webpack-encore/0.9/package.json rename to symfony/webpack-encore-pack/1.0/package.json index 1f3a0936..2e184cc8 100644 --- a/symfony/webpack-encore/0.9/package.json +++ b/symfony/webpack-encore-pack/1.0/package.json @@ -1,6 +1,6 @@ { "devDependencies": { - "@symfony/webpack-encore": "^0.9.1" + "@symfony/webpack-encore": "^0.12.0" }, "scripts": { "dev-server": "encore dev-server", diff --git a/symfony/webpack-encore/0.9/webpack.config.js b/symfony/webpack-encore-pack/1.0/webpack.config.js similarity index 100% rename from symfony/webpack-encore/0.9/webpack.config.js rename to symfony/webpack-encore-pack/1.0/webpack.config.js From a75d14cc9ad6c4f428dba9d23bbfe6ecea497dc9 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 11 Sep 2017 06:42:16 -0700 Subject: [PATCH 5/5] fixed targets in Manifest --- symfony/webpack-encore-pack/1.0/manifest.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/symfony/webpack-encore-pack/1.0/manifest.json b/symfony/webpack-encore-pack/1.0/manifest.json index 3ef80ee1..7b1ba7f4 100644 --- a/symfony/webpack-encore-pack/1.0/manifest.json +++ b/symfony/webpack-encore-pack/1.0/manifest.json @@ -1,8 +1,8 @@ { "copy-from-recipe": { - "assets/": "%PROJECT_DIR%/", - "package.json": "%PROJECT_DIR%/", - "webpack.config.js": "%PROJECT_DIR%/" + "assets/": "assets/", + "package.json": "package.json", + "webpack.config.js": "webpack.config.js" }, "aliases": ["encore", "webpack", "webpack-encore"] }