Browse Source

add Webpack Encore to the project #3

tags/Beta-1
Laszlo Lang 1 year ago
parent
commit
fd32e4c8fd
12 changed files with 5627 additions and 37 deletions
  1. +7
    -0
      .gitignore
  2. +0
    -0
      assets/.gitignore
  3. +0
    -0
      assets/css/app.scss
  4. +0
    -0
      assets/js/app.js
  5. +1
    -0
      composer.json
  6. +33
    -2
      composer.lock
  7. +3
    -0
      config/packages/assets.yaml
  8. +19
    -0
      package.json
  9. +0
    -35
      public/admin/layout.html.twig
  10. +9
    -0
      symfony.lock
  11. +53
    -0
      webpack.config.js
  12. +5502
    -0
      yarn.lock

+ 7
- 0
.gitignore View File

@@ -27,3 +27,10 @@ npm-debug.log
###< system7 - project ###



###> symfony/webpack-encore-pack ###
/node_modules/
/public/build/
npm-debug.log
yarn-error.log
###< symfony/webpack-encore-pack ###

+ 0
- 0
assets/.gitignore View File


+ 0
- 0
assets/css/app.scss View File


+ 0
- 0
assets/js/app.js View File


+ 1
- 0
composer.json View File

@@ -17,6 +17,7 @@
"symfony/orm-pack": "^1.0",
"symfony/swiftmailer-bundle": "^3.2",
"symfony/twig-bundle": "^4.1",
"symfony/webpack-encore-pack": "^1.0",
"symfony/yaml": "^4.1"
},
"require-dev": {


+ 33
- 2
composer.lock View File

@@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "f94323acc46fc167225b86cf0ca74fe0",
"content-hash": "1eeeee734173ab013843d93fb6f6f970",
"hash": "1de43cb6ca7ba3a18b762136f8599961",
"content-hash": "bde4b31209bcee7916811224485835f6",
"packages": [
{
"name": "cocur/slugify",
@@ -5948,6 +5948,37 @@
"homepage": "https://symfony.com",
"time": "2018-07-26 11:24:31"
},
{
"name": "symfony/webpack-encore-pack",
"version": "v1.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/webpack-encore-pack.git",
"reference": "8d7f51379d7ae17aea7cf501d910a11896895ac4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/webpack-encore-pack/zipball/8d7f51379d7ae17aea7cf501d910a11896895ac4",
"reference": "8d7f51379d7ae17aea7cf501d910a11896895ac4",
"shasum": ""
},
"require": {
"symfony/asset": "^3.3|^4.0"
},
"type": "symfony-pack",
"extra": {
"thanks": {
"name": "symfony/webpack-encore",
"url": "https://github.com/symfony/webpack-encore"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "A pack for Symfony Encore",
"time": "2018-07-16 10:15:28"
},
{
"name": "symfony/yaml",
"version": "v4.1.3",


+ 3
- 0
config/packages/assets.yaml View File

@@ -0,0 +1,3 @@
framework:
assets:
json_manifest_path: '%kernel.project_dir%/public/build/manifest.json'

+ 19
- 0
package.json View File

@@ -0,0 +1,19 @@
{
"devDependencies": {
"@symfony/webpack-encore": "^0.19.0",
"node-sass": "^4.9.3",
"sass-loader": "^7.1.0",
"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"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.2.0"
}
}

+ 0
- 35
public/admin/layout.html.twig View File

@@ -1,35 +0,0 @@
{% extends '@SonataAdmin/standard_layout.html.twig' %}
{#
{% block stylesheets %}
{{ parent() }}
<link rel="stylesheet" href="{{ asset('bundles/sonatatranslation/css/sonata-translation.css') }}"/>
{% endblock %}

{% block javascripts %}
{{ parent() }}
<script type="text/javascript" src="{{ asset('build/admin.js') }}"></script>
{% endblock %}
#}

{% block logo %}
{% spaceless %}
<a class="logo" href="{{ path('sonata_admin_dashboard') }}">
{#{% if 'single_image' == sonata_admin.adminPool.getOption('title_mode') or 'both' == sonata_admin.adminPool.getOption('title_mode') %}
<img src="{{ asset('/images/bear-3@1000.png') }}" alt="{{ sonata_admin.adminPool.title }}" border="0" width="50">
{% endif %}#}
{% if 'single_text' == sonata_admin.adminPool.getOption('title_mode') or 'both' == sonata_admin.adminPool.getOption('title_mode') %}
<span>{{ jotunTitle }}</span>
{% endif %}
</a>
{% endspaceless %}
{% endblock %}

{% block side_bar_after_nav_content %}
<a href="https://www.laszlolang.com" rel="noreferrer" target="_blank">
<img src="{{ asset('/images/system7-Bear-created-by-light@100.png') }}"
border="0"
alt="www.laszlolang.com"> <br>
www.laszlolang.com &copy; 2010-{{ "now"|date('Y') }} <br>
v{{ jotunVersion }}
</a>
{% endblock %}

+ 9
- 0
symfony.lock View File

@@ -392,6 +392,15 @@
"ref": "6bdfa1a95f6b2e677ab985cd1af2eae35d62e0f6"
}
},
"symfony/webpack-encore-pack": {
"version": "1.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "1.0",
"ref": "b87dfd249390a7b534caa137450277930901236e"
}
},
"symfony/yaml": {
"version": "v4.1.3"
},


+ 53
- 0
webpack.config.js View File

@@ -0,0 +1,53 @@
var Encore = require('@symfony/webpack-encore');

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/')

// uncomment if you're having problems with a jQuery plugin
.autoProvidejQuery()
.autoProvideVariables({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery'
})

/*
* 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 you JavaScript imports CSS.
*/
.addEntry('app', './assets/js/app.js')
.addStyleEntry('appStyle', './assets/css/app.scss')

/*
* 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())
.enableSassLoader(function (sassOptions) {
}, {resolveUrlLoader: false})
// enables hashed filenames (e.g. app.abc123.css)
.enableVersioning(Encore.isProduction())

// enables Sass/SCSS support
.enableSassLoader()

// uncomment if you use TypeScript
//.enableTypeScriptLoader()
;

module.exports = Encore.getWebpackConfig();

+ 5502
- 0
yarn.lock
File diff suppressed because it is too large
View File


Loading…
Cancel
Save