configure assets using function + use runtime.js

This commit is contained in:
2019-12-04 14:05:35 +01:00
parent 257d101fbe
commit 73bb897e61
5 changed files with 52 additions and 41 deletions

38
Resources/public/main.js Normal file
View File

@@ -0,0 +1,38 @@
// import jQuery
const $ = require('jquery');
// create global $ and jQuery variables
global.$ = global.jQuery = $;
const moment = require('moment');
global.moment = moment;
const pikaday = require('pikaday-jquery');
const select2 = require('select2');
global.select2 = select2;
// import js
import {chill} from './js/chill.js';
global.chill = chill;
// css
require('./sass/scratch.scss');
require('./css/chillmain.css');
require('./css/pikaday.css');
require('./js/collection/collections.js');
require('./modules/breadcrumb/index.js');
require('./modules/download-report/index.js');
//require('./css/scratch.css');
//require('./css/select2/select2.css');
require('select2/dist/css/select2.css');
require('./modules/select_interactive_loading/index.js');
require('./modules/export-list/export-list.scss');
//import {ChillShowHide} from './modules/show_hide/index.js';
//global.ChillShowHide = ChillShowHide;
// img
require('./img/favicon.ico');
require('./img/logo-chill-sans-slogan_white.png');
require('./img/logo-chill-outil-accompagnement_white.png');

View File

@@ -15,7 +15,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
<!DOCTYPE html>
<html>
<head>
@@ -48,5 +47,7 @@
<p class="forgot-password-link"><a href="{{ path('password_request_recover') }}">{{ 'Forgot your password ?'|trans }}</a></p>
</div>
<script type="text/javascript" src="{{ asset('build/runtime.js') }}"></script>
</body>
</html>

View File

@@ -142,6 +142,7 @@
{{ include('@ChillMain/Layout/_footer.html.twig') }}
<script type="text/javascript" src="{{ asset('build/runtime.js') }}"></script>
<script type="text/javascript" src="{{ asset('build/chill.js') }}"></script>
<script type="text/javascript">