Skip to content
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.

Commit

Permalink
Add symfony/webpack-encore-bundle
Browse files Browse the repository at this point in the history
Update CONTRIBUTING_WEBPACK.md

Co-authored-by: Javier Spagnoletti <[email protected]>

Update CONTRIBUTING_WEBPACK.md

Co-authored-by: Javier Spagnoletti <[email protected]>

Update CONTRIBUTING_WEBPACK.md

Co-authored-by: Javier Spagnoletti <[email protected]>

Update CONTRIBUTING_WEBPACK.md

Co-authored-by: Javier Spagnoletti <[email protected]>
  • Loading branch information
wbloszyk and phansys committed Jul 22, 2020
1 parent 0adb96c commit 7364492
Show file tree
Hide file tree
Showing 63 changed files with 17,248 additions and 17 deletions.
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,15 @@
/build

### Composer
/composer.lock
/composer.lock

###> symfony/webpack-encore-bundle ###
/node_modules/
/public/build/
npm-debug.log
yarn-error.log
/builds_configs/sonata_admin_adminlte2/node_modules/
/builds_configs/sonata_admin_adminlte3/node_modules/
/builds_configs/sonata_page_bootstrap_3/node_modules/
/builds_configs/sonata_page_bootstrap_4/node_modules/
###< symfony/webpack-encore-bundle ###
28 changes: 28 additions & 0 deletions CONTRIBUTING_WEBPACK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Contributing webpack encore
===========================

### webpack configuration

You can find configuration for each build under `builds_configs/` directory. This structure allows to use different
configurations for each layout.

```sh
cd ./builds_configs/sonata_admin_adminlte2
yarn install # to install node_modules
yarn encore dev # to generate files under `public/build/sonata_admin/`
```

### templates and css frameworks

Symfony allows to override templates ([see more][link_symfony_templates]). Use it for testing your changes.
Before creating a new PR, move this file under the chosen framework directory (for example, `templates/bootstrap3/`). You can also add other CSS frameworks
and templates for them.

### Links:

- [webpack encore dev-kit issue][link_issue]
- [symfony webpack guide][link_symfony_webpack]

[link_issue]: https://github.com/sonata-project/dev-kit/issues/779 "webpack encore dev-kit issue"
[link_symfony_webpack]: https://symfony.com/doc/current/frontend.html#webpack-encore "symfony webpack encore"
[link_symfony_templates]: https://symfony.com/doc/current/bundles/override.html "symfony override templates"
3 changes: 3 additions & 0 deletions assets/css/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
background-color: lightgray;
}
14 changes: 14 additions & 0 deletions assets/js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* 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 '../css/app.css';

// Need jQuery? Install it with "yarn add jquery", then uncomment to import it.
// import $ from 'jquery';

console.log('Hello Webpack Encore! Edit me in assets/js/app.js');
Loading

0 comments on commit 7364492

Please sign in to comment.