##// END OF EJS Templates
js: support shared styles via webpack inline
ergo -
r3179:0e268a0f default
parent child Browse files
Show More
@@ -0,0 +1,11 b''
1 const styleElement = document.createElement('dom-module');
2 import sharedCSS from 'raw-loader!./style-polymer.css';
3
4 styleElement.innerHTML =
5 `<template>
6 <style>
7 ${sharedCSS}
8 </style>
9 </template>`;
10
11 styleElement.register('shared-styles');
@@ -1,21 +1,21 b''
1 1 var gruntConfig = require('./grunt_config.json');
2 2 var webpackConfig = require('./webpack.config');
3 3 gruntConfig["webpack"] = {
4 4 options: {
5 5 stats: !process.env.NODE_ENV || process.env.NODE_ENV === 'development'
6 6 },
7 7 prod: webpackConfig,
8 8 dev: Object.assign({ watch: false }, webpackConfig)
9 9 };
10 10
11 11 module.exports = function(grunt) {
12 12 grunt.initConfig(gruntConfig);
13 13
14 14 grunt.loadNpmTasks('grunt-contrib-less');
15 15 grunt.loadNpmTasks('grunt-contrib-concat');
16 16 grunt.loadNpmTasks('grunt-contrib-watch');
17 17 grunt.loadNpmTasks('grunt-contrib-jshint');
18 18 grunt.loadNpmTasks('grunt-contrib-copy');
19 19 grunt.loadNpmTasks('grunt-webpack');
20 grunt.registerTask('default', ['less:production', 'less:components', 'concat:polymercss', 'copy', 'webpack', 'concat:dist']);
20 grunt.registerTask('default', ['less:production', 'less:components', 'copy', 'webpack', 'concat:dist']);
21 21 };
@@ -1,175 +1,174 b''
1 1 {
2 2 "dirs": {
3 3 "css": {
4 "src":"rhodecode/public/css",
5 "dest":"rhodecode/public/css"
4 "src": "rhodecode/public/css",
5 "dest": "rhodecode/public/css"
6 6 },
7 7 "js": {
8 8 "src": "rhodecode/public/js/src",
9 9 "src_rc": "rhodecode/public/js/rhodecode",
10 10 "dest": "rhodecode/public/js",
11 11 "node_modules": "node_modules"
12 12 }
13 13 },
14 14 "copy": {
15 15 "main": {
16 "expand": true,
17 "cwd": "node_modules/@webcomponents",
18 "src": "webcomponentsjs/*.*",
19 "dest": "<%= dirs.js.dest %>/vendors"
16 "files": [
17 {
18 "expand": true,
19 "cwd": "node_modules/@webcomponents",
20 "src": "webcomponentsjs/*.*",
21 "dest": "<%= dirs.js.dest %>/vendors"
22 },
23 {
24 "src": "<%= dirs.css.src %>/style-polymer.css",
25 "dest": "<%= dirs.js.dest %>/src/components/style-polymer.css"
26 }
27 ]
20 28 }
21 29 },
22 30 "concat": {
23 "polymercss": {
24 "src": [
25 "<%= dirs.js.src %>/components/root-styles-prefix.html",
26 "<%= dirs.css.src %>/style-polymer.css",
27 "<%= dirs.js.src %>/components/root-styles-suffix.html"
28 ],
29 "dest": "<%= dirs.js.dest %>/src/components/root-styles.gen.html",
30 "nonull": true
31 },
32 31 "dist": {
33 32 "src": [
34 33 "<%= dirs.js.node_modules %>/jquery/dist/jquery.min.js",
35 34 "<%= dirs.js.node_modules %>/mousetrap/mousetrap.min.js",
36 35 "<%= dirs.js.node_modules %>/moment/min/moment.min.js",
37 36 "<%= dirs.js.node_modules %>/clipboard/dist/clipboard.min.js",
38 37 "<%= dirs.js.node_modules %>/favico.js/favico-0.3.10.min.js",
39 38 "<%= dirs.js.node_modules %>/sticky-sidebar/dist/sticky-sidebar.min.js",
40 39 "<%= dirs.js.node_modules %>/sticky-sidebar/dist/jquery.sticky-sidebar.min.js",
41 40 "<%= dirs.js.node_modules %>/waypoints/lib/noframework.waypoints.min.js",
42 41 "<%= dirs.js.node_modules %>/waypoints/lib/jquery.waypoints.min.js",
43 42 "<%= dirs.js.node_modules %>/appenlight-client/appenlight-client.min.js",
44 43 "<%= dirs.js.src %>/logging.js",
45 44 "<%= dirs.js.src %>/bootstrap.js",
46 45 "<%= dirs.js.src %>/i18n_utils.js",
47 46 "<%= dirs.js.src %>/deform.js",
48 47 "<%= dirs.js.src %>/ejs.js",
49 48 "<%= dirs.js.src %>/ejs_templates/utils.js",
50 49 "<%= dirs.js.src %>/plugins/jquery.pjax.js",
51 50 "<%= dirs.js.src %>/plugins/jquery.dataTables.js",
52 51 "<%= dirs.js.src %>/plugins/flavoured_checkbox.js",
53 52 "<%= dirs.js.src %>/plugins/jquery.auto-grow-input.js",
54 53 "<%= dirs.js.src %>/plugins/jquery.autocomplete.js",
55 54 "<%= dirs.js.src %>/plugins/jquery.debounce.js",
56 55 "<%= dirs.js.src %>/plugins/jquery.mark.js",
57 56 "<%= dirs.js.src %>/plugins/jquery.timeago.js",
58 57 "<%= dirs.js.src %>/plugins/jquery.timeago-extension.js",
59 58 "<%= dirs.js.src %>/select2/select2.js",
60 59 "<%= dirs.js.src %>/codemirror/codemirror.js",
61 60 "<%= dirs.js.src %>/codemirror/codemirror_loadmode.js",
62 61 "<%= dirs.js.src %>/codemirror/codemirror_hint.js",
63 62 "<%= dirs.js.src %>/codemirror/codemirror_overlay.js",
64 63 "<%= dirs.js.src %>/codemirror/codemirror_placeholder.js",
65 64 "<%= dirs.js.src %>/codemirror/codemirror_simplemode.js",
66 65 "<%= dirs.js.dest %>/mode/meta.js",
67 66 "<%= dirs.js.dest %>/mode/meta_ext.js",
68 67 "<%= dirs.js.src_rc %>/i18n/select2/translations.js",
69 68 "<%= dirs.js.src %>/rhodecode/utils/array.js",
70 69 "<%= dirs.js.src %>/rhodecode/utils/string.js",
71 70 "<%= dirs.js.src %>/rhodecode/utils/pyroutes.js",
72 71 "<%= dirs.js.src %>/rhodecode/utils/ajax.js",
73 72 "<%= dirs.js.src %>/rhodecode/utils/autocomplete.js",
74 73 "<%= dirs.js.src %>/rhodecode/utils/colorgenerator.js",
75 74 "<%= dirs.js.src %>/rhodecode/utils/ie.js",
76 75 "<%= dirs.js.src %>/rhodecode/utils/os.js",
77 76 "<%= dirs.js.src %>/rhodecode/utils/topics.js",
78 77 "<%= dirs.js.src %>/rhodecode/init.js",
79 78 "<%= dirs.js.src %>/rhodecode/changelog.js",
80 79 "<%= dirs.js.src %>/rhodecode/codemirror.js",
81 80 "<%= dirs.js.src %>/rhodecode/comments.js",
82 81 "<%= dirs.js.src %>/rhodecode/constants.js",
83 82 "<%= dirs.js.src %>/rhodecode/files.js",
84 83 "<%= dirs.js.src %>/rhodecode/followers.js",
85 84 "<%= dirs.js.src %>/rhodecode/menus.js",
86 85 "<%= dirs.js.src %>/rhodecode/notifications.js",
87 86 "<%= dirs.js.src %>/rhodecode/permissions.js",
88 87 "<%= dirs.js.src %>/rhodecode/pjax.js",
89 88 "<%= dirs.js.src %>/rhodecode/pullrequests.js",
90 89 "<%= dirs.js.src %>/rhodecode/settings.js",
91 90 "<%= dirs.js.src %>/rhodecode/select2_widgets.js",
92 91 "<%= dirs.js.src %>/rhodecode/tooltips.js",
93 92 "<%= dirs.js.src %>/rhodecode/users.js",
94 93 "<%= dirs.js.src %>/rhodecode/appenlight.js",
95 94 "<%= dirs.js.src %>/rhodecode.js",
96 95 "<%= dirs.js.dest %>/rhodecode-components.js"
97 96 ],
98 97 "dest": "<%= dirs.js.dest %>/scripts.js",
99 98 "nonull": true
100 99 }
101 100 },
102 101 "less": {
103 102 "development": {
104 103 "options": {
105 104 "compress": false,
106 105 "yuicompress": false,
107 106 "optimization": 0
108 107 },
109 108 "files": {
110 109 "<%= dirs.css.dest %>/style.css": "<%= dirs.css.src %>/main.less",
111 110 "<%= dirs.css.dest %>/style-polymer.css": "<%= dirs.css.src %>/polymer.less"
112 111 }
113 112 },
114 113 "production": {
115 114 "options": {
116 115 "compress": true,
117 116 "yuicompress": true,
118 117 "optimization": 2
119 118 },
120 119 "files": {
121 120 "<%= dirs.css.dest %>/style.css": "<%= dirs.css.src %>/main.less",
122 121 "<%= dirs.css.dest %>/style-polymer.css": "<%= dirs.css.src %>/polymer.less"
123 122 }
124 123 },
125 124 "components": {
126 125 "files": [
127 126 {
128 127 "cwd": "<%= dirs.js.src %>/components/",
129 128 "dest": "<%= dirs.js.src %>/components/",
130 129 "src": [
131 130 "**/*.less"
132 131 ],
133 132 "expand": true,
134 133 "ext": ".css"
135 134 }
136 135 ]
137 136 }
138 137 },
139 138 "watch": {
140 139 "less": {
141 140 "files": [
142 141 "<%= dirs.css.src %>/**/*.less",
143 142 "<%= dirs.js.src %>/components/**/*.less"
144 143 ],
145 144 "tasks": [
146 145 "less:development",
147 146 "less:components",
148 147 "concat:polymercss",
149 148 "webpack",
150 149 "concat:dist"
151 150 ]
152 151 },
153 152 "js": {
154 153 "files": [
155 154 "!<%= dirs.js.src %>/components/root-styles.gen.html",
156 155 "<%= dirs.js.src %>/**/*.js",
157 156 "<%= dirs.js.src %>/components/**/*.html"
158 157 ],
159 158 "tasks": [
160 159 "less:components",
161 160 "concat:polymercss",
162 161 "webpack",
163 162 "concat:dist"
164 163 ]
165 164 }
166 165 },
167 166 "jshint": {
168 167 "rhodecode": {
169 168 "src": "<%= dirs.js.src %>/rhodecode/**/*.js",
170 169 "options": {
171 170 "jshintrc": ".jshintrc"
172 171 }
173 172 }
174 173 }
175 174 }
@@ -1,7 +1,7 b''
1 1 import '@polymer/iron-ajax/iron-ajax.js';
2 import './root-styles.gen.html';
2 import './shared-styles.js';
3 3 import './channelstream-connection/channelstream-connection.js';
4 4 import './rhodecode-toast/rhodecode-toast.js';
5 5 import './rhodecode-toggle/rhodecode-toggle.js';
6 6 import './rhodecode-unsafe-html/rhodecode-unsafe-html.js';
7 7 import './rhodecode-app/rhodecode-app.js';
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now