Skip to content

Add Webpack for creation of javascript bundles#452

Merged
martinRenou merged 23 commits into
masterfrom
add_webpack
May 16, 2017
Merged

Add Webpack for creation of javascript bundles#452
martinRenou merged 23 commits into
masterfrom
add_webpack

Conversation

@martinRenou

@martinRenou martinRenou commented May 15, 2017

Copy link
Copy Markdown
Member
  • Create a Webpack config file for building two bundles (admin and home)
  • Add babel-loader to permit the use of ES6
  • Remove requirejs and adapt each file
  • Create a Webpack config file for building a test bundle

Vue was complaining that it couldn't find the dom elements with id #appview and #applist (containers for the Vue instances).
I assume that, before using webpack, it was taking more time for the javascript to be loaded. So when the javascript code was starting to be executed, the whole page (including #appview and #applist) was already mounted. But now that the javascript file is minified, it takes less time to load it and execute it, and the dom elements are not ready yet. So we need to load the javascript only when the page is mounted. Meaning that the script element containing the javascript must be the last dom element of the body.
To resolve confusion between vue components and bower components. It will also permit to exclude properly bower components from babel (see next commit).
babel-loader will also add "use strict" in each functions automatically so we can tell jshint to not complaining about this.
It raises a "redefinition of $" but webpack will take care of it by adding jquery to the bundle only once
It will create a bundle of QUnit tests
@codecov-io

codecov-io commented May 16, 2017

Copy link
Copy Markdown

Codecov Report

Merging #452 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #452   +/-   ##
=======================================
  Coverage   95.33%   95.33%           
=======================================
  Files          88       88           
  Lines        4077     4077           
  Branches      259      259           
=======================================
  Hits         3887     3887           
  Misses        138      138           
  Partials       52       52

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0c18922...acbcf9e. Read the comment docs.

@martinRenou martinRenou changed the title Add Webpack for creation of javascript bundles [WIP] Add Webpack for creation of javascript bundles May 16, 2017
@martinRenou martinRenou merged commit 666bc05 into master May 16, 2017
@martinRenou martinRenou deleted the add_webpack branch May 16, 2017 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants