Ver código fonte

Installation webpack

tags/0.1
Guillaume 3 anos atrás
pai
commit
b756612040
19 arquivos alterados com 11629 adições e 5 exclusões
  1. +2
    -1
      .gitignore
  2. +12
    -0
      Resources/assets/app.js
  3. +15
    -0
      Resources/assets/apps/backend/common/app.common.js
  4. +1
    -0
      Resources/assets/apps/backend/common/common.js
  5. +6
    -0
      Resources/assets/apps/backend/common/common.scss
  6. +11
    -0
      Resources/assets/bootstrap.js
  7. +4
    -0
      Resources/assets/controllers.json
  8. +16
    -0
      Resources/assets/controllers/hello_controller.js
  9. +3
    -0
      Resources/assets/styles/app.css
  10. +5
    -0
      Resources/public/build/backend-common.css
  11. +60
    -0
      Resources/public/build/backend-common.js
  12. +13
    -0
      Resources/public/build/entrypoints.json
  13. +5
    -0
      Resources/public/build/manifest.json
  14. +160
    -0
      Resources/public/build/runtime.js
  15. +4
    -4
      composer.json
  16. +6377
    -0
      composer.lock
  17. +8
    -0
      package.json
  18. +74
    -0
      webpack.config.js
  19. +4853
    -0
      yarn.lock

+ 2
- 1
.gitignore Ver arquivo

@@ -1 +1,2 @@
/.idea/*
/.idea/*
/node_modules

+ 12
- 0
Resources/assets/app.js Ver arquivo

@@ -0,0 +1,12 @@
/*
* 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 import will output into a single css file (app.css in this case)
import './styles/app.css';

// start the Stimulus application
import './bootstrap';

+ 15
- 0
Resources/assets/apps/backend/common/app.common.js Ver arquivo

@@ -0,0 +1,15 @@
/*
* 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 import will output into a single css file (app.css in this case)
import './common.scss';
import './common.js';

// start the Stimulus application
//import './bootstrap';

alert('Yo !') ;

+ 1
- 0
Resources/assets/apps/backend/common/common.js Ver arquivo

@@ -0,0 +1 @@


+ 6
- 0
Resources/assets/apps/backend/common/common.scss Ver arquivo

@@ -0,0 +1,6 @@

$color: red ;

body {
background-color: $color ;
}

+ 11
- 0
Resources/assets/bootstrap.js Ver arquivo

@@ -0,0 +1,11 @@
import { startStimulusApp } from '@symfony/stimulus-bridge';

// Registers Stimulus controllers from controllers.json and in the controllers/ directory
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);

+ 4
- 0
Resources/assets/controllers.json Ver arquivo

@@ -0,0 +1,4 @@
{
"controllers": [],
"entrypoints": []
}

+ 16
- 0
Resources/assets/controllers/hello_controller.js Ver arquivo

@@ -0,0 +1,16 @@
import { Controller } from 'stimulus';

/*
* This is an example Stimulus controller!
*
* Any element with a data-controller="hello" attribute will cause
* this controller to be executed. The name "hello" comes from the filename:
* hello_controller.js -> "hello"
*
* Delete this file or adapt it for your use!
*/
export default class extends Controller {
connect() {
this.element.textContent = 'Hello Stimulus! Edit me in assets/controllers/hello_controller.js';
}
}

+ 3
- 0
Resources/assets/styles/app.css Ver arquivo

@@ -0,0 +1,3 @@
body {
background-color: lightgray;
}

+ 5
- 0
Resources/public/build/backend-common.css Ver arquivo

@@ -0,0 +1,5 @@
body {
background-color: red;
}

/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9jb21tb24uc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFHQTtFQUNFLHFCQUhNO0FBQ1IsQyIsImZpbGUiOiJiYWNrZW5kLWNvbW1vbi5jc3MiLCJzb3VyY2VzQ29udGVudCI6WyJcbiRjb2xvcjogcmVkIDtcblxuYm9keSB7XG4gIGJhY2tncm91bmQtY29sb3I6ICRjb2xvciA7XG59Il0sInNvdXJjZVJvb3QiOiIifQ==*/

+ 60
- 0
Resources/public/build/backend-common.js Ver arquivo

@@ -0,0 +1,60 @@
(self["webpackChunk"] = self["webpackChunk"] || []).push([["backend-common"],{

/***/ "./Resources/assets/apps/backend/common/app.common.js":
/*!************************************************************!*\
!*** ./Resources/assets/apps/backend/common/app.common.js ***!
\************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _common_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.scss */ "./Resources/assets/apps/backend/common/common.scss");
/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common.js */ "./Resources/assets/apps/backend/common/common.js");
/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_common_js__WEBPACK_IMPORTED_MODULE_1__);
/*
* 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 import will output into a single css file (app.css in this case)

// start the Stimulus application
//import './bootstrap';

alert('Yo !');

/***/ }),

/***/ "./Resources/assets/apps/backend/common/common.js":
/*!********************************************************!*\
!*** ./Resources/assets/apps/backend/common/common.js ***!
\********************************************************/
/***/ (() => {



/***/ }),

/***/ "./Resources/assets/apps/backend/common/common.scss":
/*!**********************************************************!*\
!*** ./Resources/assets/apps/backend/common/common.scss ***!
\**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ })

},
/******/ __webpack_require__ => { // webpackRuntimeModules
/******/ "use strict";
/******/
/******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
/******/ var __webpack_exports__ = (__webpack_exec__("./Resources/assets/apps/backend/common/app.common.js"));
/******/ }
]);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9SZXNvdXJjZXMvYX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entrypoints.json Ver arquivo

@@ -0,0 +1,13 @@
{
"entrypoints": {
"backend-common": {
"js": [
"/build/runtime.js",
"/build/backend-common.js"
],
"css": [
"/build/backend-common.css"
]
}
}
}

+ 5
- 0
Resources/public/build/manifest.json Ver arquivo

@@ -0,0 +1,5 @@
{
"build/backend-common.css": "/build/backend-common.css",
"build/backend-common.js": "/build/backend-common.js",
"build/runtime.js": "/build/runtime.js"
}

+ 160
- 0
Resources/public/build/runtime.js
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 4
- 4
composer.json Ver arquivo

@@ -3,20 +3,20 @@
"type": "symfony-bundle",
"description": "Administration for Symfony applications based on easyadmin",
"keywords": ["backend", "admin", "generator"],
"homepage": "https://gitea.laclic.fr/Laclic/AdminBundle",
"homepage": "https://gitea.laclic.fr/Laclic/SovBundle",
"license": "MIT",
"authors": [
{
"name": "La clic !",
"homepage": "laclic.fr/"
"homepage": "https://www.laclic.fr/"
}
],
"require": {
"php": ">=7.2.5",
"easycorp/easyadmin-bundle": "^3.0",
"artgris/filemanager-bundle": "^2.2",
"easycorp/easyadmin-bundle": "^3.0",
"friendsofsymfony/ckeditor-bundle": "^2.2",
"stof/doctrine-extensions-bundle": "^1.5"
"stof/doctrine-extensions-bundle": "^1.5",
},
"config": {
"sort-packages": true

+ 6377
- 0
composer.lock
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 8
- 0
package.json Ver arquivo

@@ -0,0 +1,8 @@
{
"devDependencies": {
"@symfony/webpack-encore": "^1.3.0",
"sass": "^1.32.12",
"sass-loader": "^11.0.0",
"webpack-notifier": "^1.6.0"
}
}

+ 74
- 0
webpack.config.js Ver arquivo

@@ -0,0 +1,74 @@
const 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('Resources/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/')
.enableSassLoader()
/*
* 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('backend-common', './Resources/assets/apps/backend/common/app.common.js')
//.addEntry('page1', './assets/page1.js')
//.addEntry('page2', './assets/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 require api-admin)
//.enableReactPreset()
//.addEntry('admin', './assets/admin.js')
;

module.exports = Encore.getWebpackConfig();

+ 4853
- 0
yarn.lock
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


Carregando…
Cancelar
Salvar