Added a recipe for Webpack Encore

This commit is contained in:
Javier Eguiluz
2017-09-11 06:24:16 -07:00
committed by Fabien Potencier
parent 47139d676b
commit b2980dae82
4 changed files with 42 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
{
"copy-from-recipe": {
"assets/": "%PROJECT_DIR%/",
"package.json": "%PROJECT_DIR%/",
"webpack.config.js": "%PROJECT_DIR%/"
},
"aliases": ["encore", "webpack", "webpack-encore"]
}
+11
View File
@@ -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"
}
}
@@ -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();