mirror of
https://github.com/symfony/recipes.git
synced 2026-09-12 07:36:30 +03:00
Added a recipe for Webpack Encore
This commit is contained in:
committed by
Fabien Potencier
parent
47139d676b
commit
b2980dae82
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"copy-from-recipe": {
|
||||
"assets/": "%PROJECT_DIR%/",
|
||||
"package.json": "%PROJECT_DIR%/",
|
||||
"webpack.config.js": "%PROJECT_DIR%/"
|
||||
},
|
||||
"aliases": ["encore", "webpack", "webpack-encore"]
|
||||
}
|
||||
@@ -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();
|
||||
Reference in New Issue
Block a user