Move core/systemtags to webpack

* Use webpack to bundle the core systemtags so the webserver can serve
them statically
* Bundle the core scss in there as well (saves a request)

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2019-02-04 16:53:54 +01:00
parent d576ffd487
commit 75d52dea17
No known key found for this signature in database
GPG Key ID: F941078878347C0C
8 changed files with 1330 additions and 21 deletions

View File

@ -33,9 +33,8 @@ $eventDispatcher->addListener(
'OCA\Files::loadAdditionalScripts', 'OCA\Files::loadAdditionalScripts',
function() { function() {
// FIXME: no public API for these ? // FIXME: no public API for these ?
\OCP\Util::addScript('systemtags/merged'); \OCP\Util::addScript('dist/systemtags');
\OCP\Util::addScript('systemtags', 'merged'); \OCP\Util::addScript('systemtags', 'merged');
\OCP\Util::addStyle('systemtags');
\OCP\Util::addStyle('systemtags', 'systemtagsfilelist'); \OCP\Util::addStyle('systemtags', 'systemtagsfilelist');
} }
); );

2
core/js/dist/systemtags.js vendored Normal file

File diff suppressed because one or more lines are too long

1
core/js/dist/systemtags.js.map vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,8 @@
import './systemtags.js'
import './templates.js'
import './systemtagmodel.js'
import './systemtagsmappingcollection.js'
import './systemtagscollection.js'
import './systemtagsinputfield.js'
import '../../css/systemtags.scss'

View File

@ -1,8 +0,0 @@
[
"systemtags.js",
"templates.js",
"systemtagmodel.js",
"systemtagsmappingcollection.js",
"systemtagscollection.js",
"systemtagsinputfield.js"
]

View File

@ -59,7 +59,8 @@ module.exports = [
}, },
{ {
entry: { entry: {
share_backend: path.resolve(__dirname, 'js/merged-share-backend.js') share_backend: path.resolve(__dirname, 'js/merged-share-backend.js'),
systemtags: path.resolve(__dirname, 'js/systemtags/merged-systemtags.js')
}, },
output: { output: {
filename: '[name].js', filename: '[name].js',
@ -71,7 +72,15 @@ module.exports = [
test: /\.js$/, test: /\.js$/,
loader: 'babel-loader', loader: 'babel-loader',
exclude: /node_modules/ exclude: /node_modules/
} },
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader']
},
] ]
} }
} }

1314
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -50,6 +50,8 @@
"css-loader": "^2.1.0", "css-loader": "^2.1.0",
"exports-loader": "^0.7.0", "exports-loader": "^0.7.0",
"handlebars-loader": "^1.7.1", "handlebars-loader": "^1.7.1",
"node-sass": "^4.11.0",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1", "style-loader": "^0.23.1",
"url-loader": "^1.1.2", "url-loader": "^1.1.2",
"webpack": "^4.29.1", "webpack": "^4.29.1",