no longer bundle css files within js files

This commit is contained in:
huangjx
2022-05-05 19:19:50 +08:00
parent c5a795f83e
commit c3e41f9102
6 changed files with 21 additions and 16 deletions

View File

@@ -54,7 +54,7 @@ class MainController extends Controller
// $str = \OC::$server->getDatabaseConnection()->getInner()->getPrefix(); // $str = \OC::$server->getDatabaseConnection()->getInner()->getPrefix();
//$config = \OC::$server->getAppConfig(); //$config = \OC::$server->getAppConfig();
OC_Util::addScript($this->appName, 'app'); OC_Util::addScript($this->appName, 'app');
// OC_Util::addStyle($this->appName, 'table'); OC_Util::addStyle($this->appName, 'app');
$params = $this->buildParams(); $params = $this->buildParams();
$response = new TemplateResponse($this->appName, 'Index', $params); $response = new TemplateResponse($this->appName, 'Index', $params);
return $response; return $response;

View File

@@ -68,6 +68,7 @@
"vue-loader": "^16.0.0-beta.10", "vue-loader": "^16.0.0-beta.10",
"vue-svg-loader": "^0.17.0-beta.2", "vue-svg-loader": "^0.17.0-beta.2",
"webpack": "^5.69.0", "webpack": "^5.69.0",
"webpack-cli": "^4.9.0" "webpack-cli": "^4.9.0",
"mini-css-extract-plugin": "^2.6.0"
} }
} }

View File

@@ -7,7 +7,6 @@
></div> ></div>
</template> </template>
<script> <script>
import Http from "../lib/http";
import helper from "../utils/helper"; import helper from "../utils/helper";
export default { export default {

View File

@@ -1,6 +1,6 @@
<?php <?php
script("ncdownloader", 'appSettings'); script("ncdownloader", 'appSettings');
style("ncdownloader", "settings"); style("ncdownloader", 'appSettings');
extract($_); extract($_);
?> ?>
<div class="ncdownloader-admin-settings"> <div class="ncdownloader-admin-settings">

View File

@@ -1,7 +1,6 @@
<?php <?php
script("ncdownloader", 'appSettings'); script("ncdownloader", 'appSettings');
style("ncdownloader", "autocomplete"); style("ncdownloader", 'appSettings');
style("ncdownloader", "settings");
extract($_); extract($_);
$time_map = array('i' => 'minutes', 'h' => 'hours', 'w' => 'weeks', 'd' => 'days', 'y' => 'years'); $time_map = array('i' => 'minutes', 'h' => 'hours', 'w' => 'weeks', 'd' => 'days', 'y' => 'years');
?> ?>

View File

@@ -1,6 +1,7 @@
const path = require('path'); const path = require('path');
const webpack = require('webpack'); const webpack = require('webpack');
const { VueLoaderPlugin } = require('vue-loader') const { VueLoaderPlugin } = require('vue-loader')
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = { module.exports = {
@@ -31,8 +32,10 @@ module.exports = {
{ {
test: /\.s?[ac]ss$/i, test: /\.s?[ac]ss$/i,
use: [ use: [
//Create standalone css files
MiniCssExtractPlugin.loader,
// Creates `style` nodes from JS strings // Creates `style` nodes from JS strings
"style-loader", // "style-loader",
// Translates CSS into CommonJS // Translates CSS into CommonJS
"css-loader", "css-loader",
// Compiles Sass to CSS // Compiles Sass to CSS
@@ -77,6 +80,9 @@ module.exports = {
jquery: "jQuery", jquery: "jQuery",
"window.jQuery": "jquery" "window.jQuery": "jquery"
}), }),
new MiniCssExtractPlugin({
filename: '../css/[name].css',
}),
], ],
externals: { externals: {
jquery: 'jQuery', jquery: 'jQuery',