Adam Shaw 5 лет назад
Родитель
Сommit
5a9e1e1cff

+ 1 - 1
package.json

@@ -93,7 +93,7 @@
     "rollup-plugin-node-resolve": "^4.0.1",
     "rollup-plugin-postcss": "^2.0.3",
     "rollup-plugin-replace": "^2.2.0",
-    "rollup-plugin-sass": "^1.2.2",
+    "rollup-plugin-scss": "^2.1.0",
     "rollup-plugin-sourcemaps": "^0.4.2",
     "rrule": "^2.6.2",
     "shelljs": "^0.8.3",

+ 1 - 1
packages-premium

@@ -1 +1 @@
-Subproject commit 84a6f565c273b6bf95ebeb295a33c708da8e1c52
+Subproject commit 858a9ebfbf2eee21d29c265e7d8be2e3c0ed4fed

+ 1 - 1
packages/core/src/main.scss

@@ -2,7 +2,7 @@
 @import './styles/vars';
 @import './styles/resets';
 @import './styles/utils';
-@import './styles/event';
+@import './styles/event-common';
 @import './styles/event-horizontal';
 @import './styles/icons';
 @import './styles/button';

+ 0 - 0
packages/core/src/styles/_event.scss → packages/core/src/styles/_event-common.scss


+ 1 - 1
packages/daygrid/src/main.scss

@@ -1,3 +1,3 @@
 
 @import './styles/daygrid';
-@import './styles/event';
+@import './styles/daygrid-event';

+ 0 - 0
packages/daygrid/src/styles/_event.scss → packages/daygrid/src/styles/_daygrid-event.scss


+ 1 - 1
packages/timegrid/src/main.scss

@@ -1,5 +1,5 @@
 
 @import './styles/view';
 @import './styles/time-grid';
-@import './styles/event';
+@import './styles/timegrid-event';
 @import './styles/now-indicator';

+ 0 - 0
packages/timegrid/src/styles/_event.scss → packages/timegrid/src/styles/_timegrid-event.scss


+ 11 - 6
scripts/lib/rollup-bundles.js

@@ -2,7 +2,8 @@ const path = require('path')
 const { readFileSync } = require('fs')
 const glob = require('glob')
 const nodeResolve = require('rollup-plugin-node-resolve')
-const sass = require('rollup-plugin-sass')
+// const sass = require('rollup-plugin-sass')
+const scss = require('rollup-plugin-scss') // does correct ordering
 // const postCss = require('rollup-plugin-postcss') // was only used to extra non-sass CSS. obsolete
 const { renderBanner, isRelPath, SOURCEMAP_PLUGINS, WATCH_OPTIONS, EXTERNAL_BROWSER_GLOBALS, TEMPLATE_PLUGIN, onwarn, watchSubdirSassIncludes, isScssPath } = require('./rollup-util')
 const { pkgStructs, pkgStructHash, getCorePkgStruct, getNonPremiumBundle } = require('./pkg-struct')
@@ -59,12 +60,16 @@ function buildBundleConfig(pkgStruct, isDev) {
       alias(buildAliasMap()),
       nodeResolve(), // for requiring tslib. TODO: whitelist?
       watchSubdirSassIncludes,
-      sass({
+      // sass({
+      //   output: true, // to a .css file
+      //   options: {
+      //     // core already has sass vars imported, but inject them for other modules
+      //     data: (pkgStruct.isCore ? '' : coreVarsScssString) + '\n'
+      //   }
+      // }),
+      scss({
         output: true, // to a .css file
-        options: {
-          // core already has sass vars imported, but inject them for other modules
-          data: (pkgStruct.isCore ? '' : coreVarsScssString) + '\n'
-        }
+        prefix: (pkgStruct.isCore ? '' : coreVarsScssString) + '\n'
       }),
       ...(isDev ? SOURCEMAP_PLUGINS : []),
       {

+ 11 - 6
scripts/lib/rollup-modules.js

@@ -1,7 +1,8 @@
 const path = require('path')
 const { readFileSync } = require('fs')
 const nodeResolve = require('rollup-plugin-node-resolve')
-const sass = require('rollup-plugin-sass')
+// const sass = require('rollup-plugin-sass')
+const scss = require('rollup-plugin-scss') // does correct ordering. BAD BUG: can't have SASS includes with same filename. FILE BUG
 const { renderBanner, isRelPath, isScssPath, TEMPLATE_PLUGIN, SOURCEMAP_PLUGINS, WATCH_OPTIONS, onwarn, watchSubdirSassIncludes } = require('./rollup-util')
 const { pkgStructs, getCorePkgStruct } = require('./pkg-struct')
 
@@ -42,12 +43,16 @@ function buildPkgConfig(pkgStruct, isDev) {
     plugins: [
       watchSubdirSassIncludes,
       nodeResolve(),
-      sass({
+      // sass({
+      //   output: true, // to a .css file
+      //   options: {
+      //     // core already has sass vars imported, but inject them for other modules
+      //     data: (pkgStruct.isCore ? '' : coreVarsScssString) + '\n'
+      //   }
+      // }),
+      scss({
         output: true, // to a .css file
-        options: {
-          // core already has sass vars imported, but inject them for other modules
-          data: (pkgStruct.isCore ? '' : coreVarsScssString) + '\n'
-        }
+        prefix: (pkgStruct.isCore ? '' : coreVarsScssString) + '\n'
       }),
       TEMPLATE_PLUGIN,
       ...(isDev ? SOURCEMAP_PLUGINS : []),