ENHANCEMENT: Using webpack for assets

main
Jeroen De Meerleer 1 year ago
parent 9ab63f7de1
commit 0be5d57cb3
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
  1. 2
      .gitignore
  2. 41
      assets/job/add.js
  3. 3
      assets/job/add.scss
  4. 0
      assets/job/index.js
  5. 2
      assets/job/index.scss
  6. 0
      assets/security/login.js
  7. 1
      assets/security/login.scss
  8. 3
      composer.json
  9. 1022
      composer.lock
  10. 6
      lib/Framework/Twig.php
  11. 6323
      package-lock.json
  12. 31
      package.json
  13. 3
      public/resources/job/add.css
  14. 8
      templates/base.html.twig
  15. 34
      templates/job/add.html.twig
  16. 34
      templates/job/edit.html.twig
  17. 9
      templates/job/index.html.twig
  18. 8
      templates/security/login.html.twig
  19. 78
      webpack.config.js

2
.gitignore vendored

@ -1,6 +1,8 @@
cache/*
!cache/.gitkeep
vendor/
node_modules/
public/build/
webcron.old/config.inc.php
\.idea/
.env

@ -1,3 +1,6 @@
import 'tempusdominus-bootstrap-4';
import bsCustomFileInput from 'bs-custom-file-input';
$(function() {
initDatePickers();
initCronType();
@ -21,26 +24,26 @@ function initCronType()
let type = $(this).data('type');
$('#crontypeButton').html($(this).html());
$('.crontype').val(type);
$('.crontype-inputs:not(.hidden)').addClass('hidden');
$('.crontype-' + type).removeClass('hidden');
$('.crontype-inputs:not(.d-none)').addClass('d-none');
$('.crontype-' + type).removeClass('d-none');
$('.crontype-inputs:not(.hidden) input').prop('disabled', false);
$('.crontype-inputs.hidden input').prop('disabled', true);
$('.crontype-inputs:not(.d-none) input').prop('disabled', false);
$('.crontype-inputs.d-none input').prop('disabled', true);
if(type != 'http') {
$('.croncategory-group').addClass('btn-group');
$('.croncategory-group').removeClass('hidden');
$('.croncategory-group').removeClass('d-none');
} else {
$('.croncategory-group:not(.crontype-group) button').each(function() {
$(this).html($(this).data('default-text'))
})
$('.croncategory-group').removeClass('btn-group');
$('.croncategory-group:not(.crontype-group)').addClass('hidden');
$('.croncategory-inputs:not(.crontype-inputs)').addClass('hidden');
$('.croncategory-group:not(.crontype-group)').addClass('d-none');
$('.croncategory-inputs:not(.crontype-inputs)').addClass('d-none');
$('.croncategory-inputs:not(.hidden) input').prop('disabled', false);
$('.croncategory-inputs.hidden input').prop('disabled', true);
$('.croncategory-inputs:not(.d-none) input').prop('disabled', false);
$('.croncategory-inputs.d-none input').prop('disabled', true);
}
})
}
@ -53,11 +56,11 @@ function initContainerType()
$('#containertypeButton').html($(this).html());
let type = $(this).data('type');
$('.containertype').val(type);
$('.containertype-inputs:not(.hidden)').addClass('hidden');
$('.containertype-' + type).removeClass('hidden');
$('.containertype-inputs:not(.d-none)').addClass('d-none');
$('.containertype-' + type).removeClass('d-none');
$('.containertype-inputs:not(.hidden) input').prop('disabled', false);
$('.containertype-inputs.hidden input').prop('disabled', true);
$('.containertype-inputs:not(.d-none) input').prop('disabled', false);
$('.containertype-inputs.d-none input').prop('disabled', true);
})
}
@ -70,11 +73,11 @@ function initHostType()
$('#hosttypeButton').html($(this).html());
let type = $(this).data('type');
$('.hosttype').val(type);
$('.hosttype-inputs:not(.hidden)').addClass('hidden');
$('.hosttype-' + type).removeClass('hidden');
$('.hosttype-inputs:not(.d-none)').addClass('d-none');
$('.hosttype-' + type).removeClass('d-none');
$('.hosttype-inputs:not(.hidden) input').prop('disabled', false);
$('.hosttype-inputs.hidden input').prop('disabled', true);
$('.hosttype-inputs:not(.d-none) input').prop('disabled', false);
$('.hosttype-inputs.d-none input').prop('disabled', true);
})
$('.privkey-keep').on('click', function() {
@ -86,12 +89,12 @@ function initVarInputs()
{
$('.addvar-btn').on('click', function() {
let index = $('.var-group').length;
$('.var-group:first-child').clone().appendTo('.vars').removeClass('hidden');
$('.var-group:first-child').clone().appendTo('.vars').removeClass('d-none');
$('.var-group:last-child').data({index: index});
$('.var-group:last-child .var-issecret').prop('name', 'var-issecret[' + index + ']');
$('.var-group:last-child .var-id').prop('name', 'var-id[' + index + ']');
$('.var-group:last-child .var-value').prop('name', 'var-value[' + index + ']');
$('.vars-description').removeClass('hidden');
$('.vars-description').removeClass('d-none');
})
$(document).on('click', '.var-issecret', function() {
let ischecked = $(this).prop('checked');

@ -0,0 +1,3 @@
@import "~bootstrap/dist/css/bootstrap.css";
@import "~tempusdominus-bootstrap-4/build/css/tempusdominus-bootstrap-4.css";
@import "~font-awesome";

@ -0,0 +1,2 @@
@import "~bootstrap/dist/css/bootstrap.css";
@import "~font-awesome";

@ -0,0 +1 @@
@import "~bootstrap/dist/css/bootstrap.css";

@ -17,7 +17,8 @@
"symfony/http-foundation": "^5.2",
"symfony/config": "^5.2",
"symfony/console": "^5.2",
"phpseclib/phpseclib": "^3.0"
"phpseclib/phpseclib": "^3.0",
"mehrkanal/twig-encore-extension": "^1.2"
},
"autoload": {
"psr-4": {

1022
composer.lock generated

File diff suppressed because it is too large Load Diff

@ -4,6 +4,8 @@
namespace JeroenED\Framework;
use Mehrkanal\EncoreTwigExtension\Extensions\EntryFilesTwigExtension;
use Symfony\WebpackEncoreBundle\Asset\EntrypointLookup;
use Twig\Environment;
use Twig\Loader\FilesystemLoader;
use Twig\TwigFilter;
@ -33,6 +35,7 @@ class Twig
$path = new TwigFunction('path', function(string $route, array $params = []) {
return $this->kernel->getRouter()->getUrlForRoute($route, $params);
});
$this->environment->addExtension(new EntryFilesTwigExtension(new EntrypointLookup('./public/build/entrypoints.json')));
$this->environment->addFunction($path);
}
@ -55,7 +58,4 @@ class Twig
});
$this->environment->addFilter($secondsToInterval);
}
}

6323
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,31 @@
{
"name": "webcron",
"version": "1.0.0",
"description": "(c) 2017, 2021 Jeroen De Meerleer <me@jeroened.be>",
"main": "webpack.config.js",
"directories": {
"lib": "lib"
},
"dependencies": {
"bootstrap": "^4.6.0",
"bs-custom-file-input": "^1.3.4",
"font-awesome": "^4.7.0",
"jquery": "^3.6.0",
"moment": "^2.29.1",
"tempusdominus-bootstrap-4": "^5.39.0"
},
"devDependencies": {
"@symfony/webpack-encore": "^1.3.0",
"sass": "^1.34.0",
"sass-loader": "^11.1.1"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://git.jeroened.be/webcron/webcron.git"
},
"author": "Jeroen De Meerleer <me@jeroened.be>",
"license": " AGPL-3.0-or-later"
}

@ -1,3 +0,0 @@
.hidden {
display: none;
}

@ -5,13 +5,9 @@
<title>Webcron management :: {% block title %}{% endblock %}</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
{% block extrastyles %}{% endblock %}
{% block styles %}{% endblock %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-Piv4xVNRyMGpqkS2by6br4gNJ7DXjqk09RmUpJ8jgGtD7zP9yug3goQfGII0yAns" crossorigin="anonymous"></script>
{% block extrascripts %}{% endblock %}
{% block scripts %}{% endblock %}
</head>

@ -49,7 +49,7 @@
</div>
</div>
<div class="dropdown croncategory-group hidden hosttype-group">
<div class="dropdown croncategory-group d-none hosttype-group">
<button class="btn btn-outline-primary dropdown-toggle" type="button" id="hosttypeButton" data-default-text="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Host type
</button>
@ -59,7 +59,7 @@
</div>
</div>
<div class="dropdown croncategory-group hidden containertype-group">
<div class="dropdown croncategory-group d-none containertype-group">
<button class="btn btn-outline-primary dropdown-toggle" type="button" id="containertypeButton" data-default-text="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Container
</button>
@ -70,7 +70,7 @@
</div>
</div>
<div class="crontype-command crontype-inputs croncategory-inputs hidden">
<div class="crontype-command crontype-inputs croncategory-inputs d-none">
<h4>Command details</h4>
<div class="mb-3">
<label for="command">Command</label>
@ -83,7 +83,7 @@
</div>
</div>
<div class="crontype-reboot crontype-inputs croncategory-inputs hidden">
<div class="crontype-reboot crontype-inputs croncategory-inputs d-none">
<h4>Reboot job details</h4>
<div class="mb-3">
<label for="reboot-command">Reboot command</label>
@ -109,7 +109,7 @@
</div>
</div>
<div class="crontype-http crontype-inputs croncategory-inputs hidden">
<div class="crontype-http crontype-inputs croncategory-inputs d-none">
<h4>HTTP request details</h4>
<div class="mb-3">
<label for="url">Url</label>
@ -131,12 +131,12 @@
</div>
</div>
<div class="hosttype-local hosttype-inputs croncategory-inputs hidden">
<div class="hosttype-local hosttype-inputs croncategory-inputs d-none">
<h4>Localhost details</h4>
<h5>No options</h5>
</div>
<div class="hosttype-ssh hosttype-inputs croncategory-inputs hidden">
<div class="hosttype-ssh hosttype-inputs croncategory-inputs d-none">
<h4>SSH host details</h4>
<div class="mb-3">
<label for="host">Hostname</label>
@ -165,10 +165,10 @@
</div>
</div>
<div class="containertype-none containertype-inputs croncategory-inputs hidden">
<div class="containertype-none containertype-inputs croncategory-inputs d-none">
</div>
<div class="containertype-docker containertype-inputs croncategory-inputs hidden">
<div class="containertype-docker containertype-inputs croncategory-inputs d-none">
<h4>Docker container details</h4>
<div class="mb-3">
<label for="service">Service</label>
@ -184,7 +184,7 @@
<h3>Variables</h3>
<div class="vars mb-3">
<div class="input-group var-group hidden">
<div class="input-group var-group d-none">
<div class="input-group-prepend">
<div class="input-group-text border-right-0">
<input type="checkbox" name="var-issecret[0]" class="var-issecret" placeholder="value" value="true">
@ -197,7 +197,7 @@
</div>
</div>
<div class="vars-description mb-3 hidden">
<div class="vars-description mb-3 d-none">
<p>
You can add variables by using {variable-name} in job details
</p>
@ -214,14 +214,10 @@
{% endblock %}
{% block extrastyles %}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.39.0/css/tempusdominus-bootstrap-4.min.css" integrity="sha512-3JRrEUwaCkFUBLK1N8HehwQgu8e23jTH4np5NHOmQOobuC4ROQxFwFgBLTnhcnQRMs84muMh0PnnwXlPq5MGjg==" crossorigin="anonymous" />
<link rel="stylesheet" href="/resources/job/add.css" />
{% block styles %}
{{ encore_entry_link_tags('job.add') }}
{% endblock %}
{% block extrascripts %}
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js" integrity="sha512-qTXRIMyZIFb8iQcfjXWCO8+M5Tbc38Qi5WzdPOYZHIlZpzBHG3L3by84BBBOiRGiEb7KKtAOAs5qYdUiZiQNNQ==" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.39.0/js/tempusdominus-bootstrap-4.min.js" integrity="sha512-k6/Bkb8Fxf/c1Tkyl39yJwcOZ1P4cRrJu77p83zJjN2Z55prbFHxPs9vN7q3l3+tSMGPDdoH51AEU8Vgo1cgAA==" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bs-custom-file-input/1.3.4/bs-custom-file-input.min.js" integrity="sha512-91BoXI7UENvgjyH31ug0ga7o1Ov41tOzbMM3+RPqFVohn1UbVcjL/f5sl6YSOFfaJp+rF+/IEbOOEwtBONMz+w==" crossorigin="anonymous"></script>
<script type="text/javascript" src="/resources/job/add.js"></script>
{% block scripts %}
{{ encore_entry_script_tags('job.add') }}
{% endblock %}

@ -55,7 +55,7 @@
</div>
</div>
<div class="dropdown croncategory-group hosttype-group{% if data.crontype != 'http' %} btn-group{% else %} hidden{% endif %}">
<div class="dropdown croncategory-group hosttype-group{% if data.crontype != 'http' %} btn-group{% else %} d-none{% endif %}">
<button class="btn btn-outline-primary dropdown-toggle" type="button" id="hosttypeButton" data-default-text="Host type" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{% if data.hosttype == 'local' %}
Local
@ -69,7 +69,7 @@
</div>
</div>
<div class="dropdown croncategory-group containertype-group{% if data.crontype != 'http' %} btn-group{% else %} hidden{% endif %}">
<div class="dropdown croncategory-group containertype-group{% if data.crontype != 'http' %} btn-group{% else %} d-none{% endif %}">
<button class="btn btn-outline-primary dropdown-toggle" type="button" id="containertypeButton" data-default-text="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{% if data.containertype == 'none' %}
None
@ -84,7 +84,7 @@
</div>
</div>
<div class="crontype-command crontype-inputs croncategory-inputs{% if data.crontype != 'command' %} hidden{% endif %}">
<div class="crontype-command crontype-inputs croncategory-inputs{% if data.crontype != 'command' %} d-none{% endif %}">
<h4>Command details</h4>
<div class="mb-3">
<label for="command">Command</label>
@ -97,7 +97,7 @@
</div>
</div>
<div class="crontype-reboot crontype-inputs croncategory-inputs{% if data.crontype != 'reboot' %} hidden{% endif %}">
<div class="crontype-reboot crontype-inputs croncategory-inputs{% if data.crontype != 'reboot' %} d-none{% endif %}">
<h4>Reboot job details</h4>
<div class="mb-3">
<label for="reboot-command">Reboot command</label>
@ -123,7 +123,7 @@
</div>
</div>
<div class="crontype-http crontype-inputs croncategory-inputs{% if data.crontype != 'http' %} hidden{% endif %}">
<div class="crontype-http crontype-inputs croncategory-inputs{% if data.crontype != 'http' %} d-none{% endif %}">
<h4>HTTP request details</h4>
<div class="mb-3">
<label for="url">Url</label>
@ -145,12 +145,12 @@
</div>
</div>
<div class="hosttype-local hosttype-inputs croncategory-inputs{% if data.hosttype != 'local' %} hidden{% endif %}">
<div class="hosttype-local hosttype-inputs croncategory-inputs{% if data.hosttype != 'local' %} d-none{% endif %}">
<h4>Localhost details</h4>
<h5>No options</h5>
</div>
<div class="hosttype-ssh hosttype-inputs croncategory-inputs{% if data.hosttype != 'ssh' %} hidden{% endif %}">
<div class="hosttype-ssh hosttype-inputs croncategory-inputs{% if data.hosttype != 'ssh' %} d-none{% endif %}">
<h4>SSH host details</h4>
<div class="mb-3">
<label for="host">Hostname</label>
@ -188,10 +188,10 @@
</div>
</div>
<div class="containertype-none containertype-inputs croncategory-inputs{% if data.containertype != 'none' %} hidden{% endif %}">
<div class="containertype-none containertype-inputs croncategory-inputs{% if data.containertype != 'none' %} d-none{% endif %}">
</div>
<div class="containertype-docker containertype-inputs croncategory-inputs{% if data.containertype != 'docker' %} hidden{% endif %}">
<div class="containertype-docker containertype-inputs croncategory-inputs{% if data.containertype != 'docker' %} d-none{% endif %}">
<h4>Docker container details</h4>
<div class="mb-3">
<label for="service">Service</label>
@ -207,7 +207,7 @@
<h3>Variables</h3>
<div class="vars mb-3">
<div class="input-group var-group hidden">
<div class="input-group var-group d-none">
<div class="input-group-prepend">
<div class="input-group-text border-right-0">
<input type="checkbox" name="var-issecret[0]" class="var-issecret" placeholder="value" value="true">
@ -232,7 +232,7 @@
{% endfor %}
</div>
<div class="vars-description mb-3 hidden">
<div class="vars-description mb-3 d-none">
<p>
You can add variables by using {variable-name} in job details
</p>
@ -249,14 +249,10 @@
{% endblock %}
{% block extrastyles %}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.39.0/css/tempusdominus-bootstrap-4.min.css" integrity="sha512-3JRrEUwaCkFUBLK1N8HehwQgu8e23jTH4np5NHOmQOobuC4ROQxFwFgBLTnhcnQRMs84muMh0PnnwXlPq5MGjg==" crossorigin="anonymous" />
<link rel="stylesheet" href="/resources/job/add.css" />
{% block styles %}
{{ encore_entry_link_tags('job.add') }}
{% endblock %}
{% block extrascripts %}
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js" integrity="sha512-qTXRIMyZIFb8iQcfjXWCO8+M5Tbc38Qi5WzdPOYZHIlZpzBHG3L3by84BBBOiRGiEb7KKtAOAs5qYdUiZiQNNQ==" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.39.0/js/tempusdominus-bootstrap-4.min.js" integrity="sha512-k6/Bkb8Fxf/c1Tkyl39yJwcOZ1P4cRrJu77p83zJjN2Z55prbFHxPs9vN7q3l3+tSMGPDdoH51AEU8Vgo1cgAA==" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bs-custom-file-input/1.3.4/bs-custom-file-input.min.js" integrity="sha512-91BoXI7UENvgjyH31ug0ga7o1Ov41tOzbMM3+RPqFVohn1UbVcjL/f5sl6YSOFfaJp+rF+/IEbOOEwtBONMz+w==" crossorigin="anonymous"></script>
<script type="text/javascript" src="/resources/job/add.js"></script>
{% block scripts %}
{{ encore_entry_script_tags('job.add') }}
{% endblock %}

@ -50,9 +50,10 @@
</div>
{% endblock %}
{% block extrastyles %}
<link rel="stylesheet" href="/resources/job/index.css" />
{% block styles %}
{{ encore_entry_link_tags('job.index') }}
{% endblock %}
{% block extrascripts %}
<script type="text/javascript" src="/resources/job/index.js"></script>
{% block scripts %}
{{ encore_entry_script_tags('job.index') }}
{% endblock %}

@ -4,13 +4,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Webcron management :: Log in</title>
{{ encore_entry_link_tags('security.login') }}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
<link rel="stylesheet" href="/css/site.css">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-Piv4xVNRyMGpqkS2by6br4gNJ7DXjqk09RmUpJ8jgGtD7zP9yug3goQfGII0yAns" crossorigin="anonymous"></script>
<script src="/js/site.js" type="text/javascript"></script>
{{ encore_entry_script_tags('security.login') }}
</head>
<body>

@ -0,0 +1,78 @@
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('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('security.login', ['./assets/security/login.js', './assets/security/login.scss'])
.addEntry('job.index', ['./assets/job/index.js', './assets/job/index.scss'])
.addEntry('job.add', ['./assets/job/add.js', './assets/job/add.scss'])
//.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 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')
.autoProvideVariables({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
moment: 'moment',
boostrap: 'bootstrap'
})
;
module.exports = Encore.getWebpackConfig();
Loading…
Cancel
Save