Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b7c6302a
Commit
b7c6302a
authored
Jul 18, 2017
by
Bob Van Landuyt
Committed by
Toon Claes
Aug 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some info on how to split EE-specific JS code
parent
df9805b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
doc/development/ee_features.md
doc/development/ee_features.md
+24
-0
No files found.
doc/development/ee_features.md
View file @
b7c6302a
...
...
@@ -251,3 +251,27 @@ Instead add a file in a `/ee/` sub-folder.
When doing this, rubocop might complain about the path not
matching. So on the top-level
`describe`
append
`# rubocop:disable
RSpec/FilePath`
to disable the cop for that line.
## JS-code
To seperate EE-specific JS-files we can also move the files into an
`ee`
folder.
For example there can be an
`app/assets/javascripts/protected_branches/protected_branches_bundle.js`
and an
ee counterpart
`app/assets/javascripts/protected_branches/ee/protected_branches_bundle.js`
.
That way we can create a separate webpack bundle in
`webpack.config.js`
:
```
javascript
ee_protected_branches
:
'
./protected_branches/ee/protected_branches_bundle.js
'
,
protected_tags
:
'
./protected_tags
'
,
```
With the separate bundle in place, we can decide which bundle to load inside the
view, using the
`page_specific_javascript_bundle_tag`
helper.
```
- content_for :page_specific_javascripts do
= page_specific_javascript_bundle_tag('protected_branches')
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment