mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Updated webpack-encore recipe.
This commit is contained in:
parent
9ae8e55b9e
commit
ae67b55bf1
7 changed files with 45 additions and 24 deletions
10
assets/bootstrap.js
vendored
10
assets/bootstrap.js
vendored
|
@ -1,5 +1,11 @@
|
||||||
import { startStimulusApp } from '@symfony/stimulus-bridge';
|
import { startStimulusApp } from '@symfony/stimulus-bridge';
|
||||||
import '@symfony/autoimport';
|
|
||||||
|
|
||||||
// Registers Stimulus controllers from controllers.json and in the controllers/ directory
|
// Registers Stimulus controllers from controllers.json and in the controllers/ directory
|
||||||
export const app = startStimulusApp(require.context('./controllers', true, /\.(j|t)sx?$/));
|
export const app = startStimulusApp(require.context(
|
||||||
|
'@symfony/stimulus-bridge/lazy-controller-loader!./controllers',
|
||||||
|
true,
|
||||||
|
/\.(j|t)sx?$/
|
||||||
|
));
|
||||||
|
|
||||||
|
// register any custom, 3rd party controllers here
|
||||||
|
// app.register('some_controller_name', SomeImportedController);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# see https://symfony.com/doc/current/reference/configuration/framework.html
|
# see https://symfony.com/doc/current/reference/configuration/framework.html
|
||||||
framework:
|
framework:
|
||||||
secret: '%env(APP_SECRET)%'
|
secret: '%env(APP_SECRET)%'
|
||||||
#csrf_protection: true
|
csrf_protection: true
|
||||||
http_method_override: false
|
http_method_override: false
|
||||||
|
|
||||||
# Enables session support. Note that the session will ONLY be started if you read or write from it.
|
# Enables session support. Note that the session will ONLY be started if you read or write from it.
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
webpack_encore:
|
#webpack_encore:
|
||||||
# Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes)
|
# Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes)
|
||||||
# Available in version 1.2
|
# Available in version 1.2
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
# Preload in production
|
|
||||||
preload: true
|
|
|
@ -4,16 +4,26 @@ webpack_encore:
|
||||||
# If multiple builds are defined (as shown below), you can disable the default build:
|
# If multiple builds are defined (as shown below), you can disable the default build:
|
||||||
# output_path: false
|
# output_path: false
|
||||||
|
|
||||||
# if using Encore.enableIntegrityHashes() and need the crossorigin attribute (default: false, or use 'anonymous' or 'use-credentials')
|
# Set attributes that will be rendered on all script and link tags
|
||||||
|
script_attributes:
|
||||||
|
defer: true
|
||||||
|
# Uncomment (also under link_attributes) if using Turbo Drive
|
||||||
|
# https://turbo.hotwired.dev/handbook/drive#reloading-when-assets-change
|
||||||
|
# 'data-turbo-track': reload
|
||||||
|
# link_attributes:
|
||||||
|
# Uncomment if using Turbo Drive
|
||||||
|
# 'data-turbo-track': reload
|
||||||
|
|
||||||
|
# If using Encore.enableIntegrityHashes() and need the crossorigin attribute (default: false, or use 'anonymous' or 'use-credentials')
|
||||||
# crossorigin: 'anonymous'
|
# crossorigin: 'anonymous'
|
||||||
|
|
||||||
# preload all rendered script and link tags automatically via the http2 Link header
|
# Preload all rendered script and link tags automatically via the HTTP/2 Link header
|
||||||
preload: false
|
preload: true
|
||||||
|
|
||||||
# Throw an exception if the entrypoints.json file is missing or an entry is missing from the data
|
# Throw an exception if the entrypoints.json file is missing or an entry is missing from the data
|
||||||
# strict_mode: false
|
# strict_mode: false
|
||||||
|
|
||||||
# if you have multiple builds:
|
# If you have multiple builds:
|
||||||
# builds:
|
# builds:
|
||||||
# pass "frontend" as the 3rg arg to the Twig functions
|
# pass "frontend" as the 3rg arg to the Twig functions
|
||||||
# {{ encore_entry_script_tags('entry1', null, 'frontend') }}
|
# {{ encore_entry_script_tags('entry1', null, 'frontend') }}
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
{
|
{
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@fortawesome/fontawesome-free": "^5.7.2",
|
"@fortawesome/fontawesome-free": "^5.7.2",
|
||||||
"@symfony/stimulus-bridge": "^2.1.0",
|
"@symfony/stimulus-bridge": "^2.0.0",
|
||||||
"@symfony/webpack-encore": "1.6.1",
|
"@symfony/webpack-encore": "^1.6.1",
|
||||||
"bootstrap": "^4.4.1",
|
"bootstrap": "^4.4.1",
|
||||||
"core-js": "^3.6.4",
|
"core-js": "^3.6.4",
|
||||||
"jquery": "^3.5.1",
|
"jquery": "^3.5.1",
|
||||||
"popper.js": "^1.14.7",
|
"popper.js": "^1.14.7",
|
||||||
"@popperjs/core": "^2.10.2",
|
"@popperjs/core": "^2.10.2",
|
||||||
"regenerator-runtime": "^0.13.2",
|
"regenerator-runtime": "^0.13.2",
|
||||||
"stimulus": "^3.0.0",
|
"stimulus": "^2.0.0",
|
||||||
"webpack-bundle-analyzer": "^4.3.0",
|
"webpack-bundle-analyzer": "^4.3.0",
|
||||||
"webpack-notifier": "^1.6.0"
|
"webpack-notifier": "^1.6.0"
|
||||||
},
|
},
|
||||||
|
|
|
@ -791,12 +791,12 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"symfony/webpack-encore-bundle": {
|
"symfony/webpack-encore-bundle": {
|
||||||
"version": "1.6",
|
"version": "1.9",
|
||||||
"recipe": {
|
"recipe": {
|
||||||
"repo": "github.com/symfony/recipes",
|
"repo": "github.com/symfony/recipes",
|
||||||
"branch": "master",
|
"branch": "master",
|
||||||
"version": "1.6",
|
"version": "1.9",
|
||||||
"ref": "f362ed8e8aa99a8cb216e6bdb2ac833dfb7643dd"
|
"ref": "0f274572ea315eb3b5884518a50ca43f211b4534"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"./assets/app.js",
|
"./assets/app.js",
|
||||||
|
|
|
@ -57,9 +57,10 @@ Encore
|
||||||
* and one CSS file (e.g. app.css) if you JavaScript imports CSS.
|
* and one CSS file (e.g. app.css) if you JavaScript imports CSS.
|
||||||
*/
|
*/
|
||||||
.addEntry('app', './assets/js/app.js')
|
.addEntry('app', './assets/js/app.js')
|
||||||
|
|
||||||
.addEntry('ru2ftwofactor', './assets/js/u2f_auth.js')
|
.addEntry('ru2ftwofactor', './assets/js/u2f_auth.js')
|
||||||
//.addEntry('ajaxUI', './assets/ts_src/ajax_ui.ts')
|
|
||||||
|
// enables the Symfony UX Stimulus bridge (used in assets/bootstrap.js)
|
||||||
|
.enableStimulusBridge('./assets/controllers.json')
|
||||||
//.addEntry('page1', './assets/js/page1.js')
|
//.addEntry('page1', './assets/js/page1.js')
|
||||||
//.addEntry('page2', './assets/js/page2.js')
|
//.addEntry('page2', './assets/js/page2.js')
|
||||||
|
|
||||||
|
@ -83,6 +84,10 @@ Encore
|
||||||
// enables hashed filenames (e.g. app.abc123.css)
|
// enables hashed filenames (e.g. app.abc123.css)
|
||||||
.enableVersioning(Encore.isProduction())
|
.enableVersioning(Encore.isProduction())
|
||||||
|
|
||||||
|
.configureBabel((config) => {
|
||||||
|
config.plugins.push('@babel/plugin-proposal-class-properties');
|
||||||
|
})
|
||||||
|
|
||||||
// enables @babel/preset-env polyfills
|
// enables @babel/preset-env polyfills
|
||||||
.configureBabelPresetEnv((config) => {
|
.configureBabelPresetEnv((config) => {
|
||||||
config.useBuiltIns = 'usage';
|
config.useBuiltIns = 'usage';
|
||||||
|
@ -94,9 +99,12 @@ Encore
|
||||||
// uncomment if you use TypeScript
|
// uncomment if you use TypeScript
|
||||||
.enableTypeScriptLoader()
|
.enableTypeScriptLoader()
|
||||||
|
|
||||||
// uncomment if you're having problems with a jQuery plugin
|
// uncomment if you use React
|
||||||
.autoProvidejQuery()
|
//.enableReactPreset()
|
||||||
|
|
||||||
|
// uncomment to get integrity="..." attributes on your script & link tags
|
||||||
|
// requires WebpackEncoreBundle 1.4 or higher
|
||||||
|
.enableIntegrityHashes(Encore.isProduction())
|
||||||
.addPlugin(new CopyPlugin([
|
.addPlugin(new CopyPlugin([
|
||||||
{
|
{
|
||||||
from: 'node_modules/bootswatch/dist/*/*.min.css',
|
from: 'node_modules/bootswatch/dist/*/*.min.css',
|
||||||
|
@ -109,9 +117,9 @@ Encore
|
||||||
}
|
}
|
||||||
]))
|
]))
|
||||||
|
|
||||||
// uncomment if you use API Platform Admin (composer req api-admin)
|
// uncomment if you're having problems with a jQuery plugin
|
||||||
//.enableReactPreset()
|
.autoProvidejQuery()
|
||||||
//.addEntry('admin', './assets/js/admin.js')
|
|
||||||
;
|
;
|
||||||
|
|
||||||
if (Encore.isProduction()) {
|
if (Encore.isProduction()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue