mirror of
https://github.com/symfony/recipes.git
synced 2026-09-15 00:56:24 +03:00
199 lines
10 KiB
JSON
199 lines
10 KiB
JSON
{
|
|
"manifests": {
|
|
"symfony/webpack-encore-bundle": {
|
|
"manifest": {
|
|
"bundles": {
|
|
"Symfony\\WebpackEncoreBundle\\WebpackEncoreBundle": [
|
|
"all"
|
|
]
|
|
},
|
|
"copy-from-recipe": {
|
|
"assets/": "assets/",
|
|
"config/": "%CONFIG_DIR%/",
|
|
"package.json": "package.json",
|
|
"webpack.config.js": "webpack.config.js"
|
|
},
|
|
"gitignore": [
|
|
"/node_modules/",
|
|
"/%PUBLIC_DIR%/build/",
|
|
"npm-debug.log",
|
|
"yarn-error.log"
|
|
]
|
|
},
|
|
"files": {
|
|
"assets/css/app.css": {
|
|
"contents": [
|
|
"body {",
|
|
" background-color: lightgray;",
|
|
"}",
|
|
""
|
|
],
|
|
"executable": false
|
|
},
|
|
"assets/js/app.js": {
|
|
"contents": [
|
|
"/*",
|
|
" * Welcome to your app's main JavaScript file!",
|
|
" *",
|
|
" * We recommend including the built version of this JavaScript file",
|
|
" * (and its CSS file) in your base layout (base.html.twig).",
|
|
" */",
|
|
"",
|
|
"// any CSS you require will output into a single css file (app.css in this case)",
|
|
"require('../css/app.css');",
|
|
"",
|
|
"// Need jQuery? Install it with \"yarn add jquery\", then uncomment to require it.",
|
|
"// const $ = require('jquery');",
|
|
"",
|
|
"console.log('Hello Webpack Encore! Edit me in assets/js/app.js');",
|
|
""
|
|
],
|
|
"executable": false
|
|
},
|
|
"config/packages/assets.yaml": {
|
|
"contents": [
|
|
"framework:",
|
|
" assets:",
|
|
" json_manifest_path: '%kernel.project_dir%/public/build/manifest.json'",
|
|
""
|
|
],
|
|
"executable": false
|
|
},
|
|
"config/packages/prod/webpack_encore.yaml": {
|
|
"contents": [
|
|
"#webpack_encore:",
|
|
" # Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes)",
|
|
" # Available in version 1.2",
|
|
" #cache: true",
|
|
""
|
|
],
|
|
"executable": false
|
|
},
|
|
"config/packages/webpack_encore.yaml": {
|
|
"contents": [
|
|
"webpack_encore:",
|
|
" # The path where Encore is building the assets.",
|
|
" # This should match Encore.setOutputPath() in webpack.config.js.",
|
|
" output_path: '%kernel.project_dir%/public/build'",
|
|
" # If multiple builds are defined (as shown below), you can disable the default build:",
|
|
" # output_path: false",
|
|
"",
|
|
" # if using Encore.enableIntegrityHashes() specify the crossorigin attribute value (default: false, or use 'anonymous' or 'use-credentials')",
|
|
" # crossorigin: 'anonymous'",
|
|
"",
|
|
" # Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes).",
|
|
" # To enable caching for the production environment, creating a webpack_encore.yaml in the config/packages/prod directory with this value set to true",
|
|
" # Available in version 1.2",
|
|
" #cache: false",
|
|
""
|
|
],
|
|
"executable": false
|
|
},
|
|
"package.json": {
|
|
"contents": [
|
|
"{",
|
|
" \"devDependencies\": {",
|
|
" \"@symfony/webpack-encore\": \"^0.28.2\",",
|
|
" \"core-js\": \"^3.0.0\",",
|
|
" \"regenerator-runtime\": \"^0.13.2\",",
|
|
" \"webpack-notifier\": \"^1.6.0\"",
|
|
" },",
|
|
" \"license\": \"UNLICENSED\",",
|
|
" \"private\": true,",
|
|
" \"scripts\": {",
|
|
" \"dev-server\": \"encore dev-server\",",
|
|
" \"dev\": \"encore dev\",",
|
|
" \"watch\": \"encore dev --watch\",",
|
|
" \"build\": \"encore production --progress\"",
|
|
" }",
|
|
"}",
|
|
""
|
|
],
|
|
"executable": false
|
|
},
|
|
"webpack.config.js": {
|
|
"contents": [
|
|
"var Encore = require('@symfony/webpack-encore');",
|
|
"",
|
|
"// Manually configure the runtime environment if not already configured yet by the \"encore\" command.",
|
|
"// It's useful when you use tools that rely on webpack.config.js file.",
|
|
"if (!Encore.isRuntimeEnvironmentConfigured()) {",
|
|
" Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');",
|
|
"}",
|
|
"",
|
|
"Encore",
|
|
" // directory where compiled assets will be stored",
|
|
" .setOutputPath('public/build/')",
|
|
" // public path used by the web server to access the output path",
|
|
" .setPublicPath('/build')",
|
|
" // only needed for CDN's or sub-directory deploy",
|
|
" //.setManifestKeyPrefix('build/')",
|
|
"",
|
|
" /*",
|
|
" * ENTRY CONFIG",
|
|
" *",
|
|
" * Add 1 entry for each \"page\" of your app",
|
|
" * (including one that's included on every page - e.g. \"app\")",
|
|
" *",
|
|
" * Each entry will result in one JavaScript file (e.g. app.js)",
|
|
" * and one CSS file (e.g. app.css) if your JavaScript imports CSS.",
|
|
" */",
|
|
" .addEntry('app', './assets/js/app.js')",
|
|
" //.addEntry('page1', './assets/js/page1.js')",
|
|
" //.addEntry('page2', './assets/js/page2.js')",
|
|
"",
|
|
" // When enabled, Webpack \"splits\" your files into smaller pieces for greater optimization.",
|
|
" .splitEntryChunks()",
|
|
"",
|
|
" // will require an extra script tag for runtime.js",
|
|
" // but, you probably want this, unless you're building a single-page app",
|
|
" .enableSingleRuntimeChunk()",
|
|
"",
|
|
" /*",
|
|
" * FEATURE CONFIG",
|
|
" *",
|
|
" * Enable & configure other features below. For a full",
|
|
" * list of features, see:",
|
|
" * https://symfony.com/doc/current/frontend.html#adding-more-features",
|
|
" */",
|
|
" .cleanupOutputBeforeBuild()",
|
|
" .enableBuildNotifications()",
|
|
" .enableSourceMaps(!Encore.isProduction())",
|
|
" // enables hashed filenames (e.g. app.abc123.css)",
|
|
" .enableVersioning(Encore.isProduction())",
|
|
"",
|
|
" // enables @babel/preset-env polyfills",
|
|
" .configureBabelPresetEnv((config) => {",
|
|
" config.useBuiltIns = 'usage';",
|
|
" config.corejs = 3;",
|
|
" });",
|
|
"",
|
|
" // enables Sass/SCSS support",
|
|
" //.enableSassLoader()",
|
|
"",
|
|
" // uncomment if you use TypeScript",
|
|
" //.enableTypeScriptLoader()",
|
|
"",
|
|
" // uncomment to get integrity=\"...\" attributes on your script & link tags",
|
|
" // requires WebpackEncoreBundle 1.4 or higher",
|
|
" //.enableIntegrityHashes(Encore.isProduction())",
|
|
"",
|
|
" // uncomment if you're having problems with a jQuery plugin",
|
|
" //.autoProvidejQuery()",
|
|
"",
|
|
" // uncomment if you use API Platform Admin (composer req api-admin)",
|
|
" //.enableReactPreset()",
|
|
" //.addEntry('admin', './assets/js/admin.js')",
|
|
";",
|
|
"",
|
|
"module.exports = Encore.getWebpackConfig();",
|
|
""
|
|
],
|
|
"executable": false
|
|
}
|
|
},
|
|
"ref": "cee9cba3be86a8e5b90dfeff714f514cdc1d302a"
|
|
}
|
|
}
|
|
}
|