Skip to content

Commit

Permalink
feat: 增加 sass 示例
Browse files Browse the repository at this point in the history
  • Loading branch information
xuasir committed Mar 17, 2021
1 parent 5691a96 commit 044c305
Show file tree
Hide file tree
Showing 8 changed files with 189 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/playground/sass/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "playground-asset",
"version": "0.0.0",
"scripts": {
"build": "npx xus lib-build"
},
"license": "MIT",
"dependencies": {
"react": "^17.0.1",
"sass": "^1.32.8"
}
}
5 changes: 5 additions & 0 deletions packages/playground/sass/src/app.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@import './var.scss';

.text {
color: $black;
}
6 changes: 6 additions & 0 deletions packages/playground/sass/src/app.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@import './var.scss';

div {
font-size: 26px;
background-color: $red;
}
12 changes: 12 additions & 0 deletions packages/playground/sass/src/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React, { useState } from 'react'
import './app.scss'
import { text } from './app.module.scss'

export const App = () => {
const [d] = useState(0)
return (
<>
<div class={text}>{d}</div>
</>
)
}
1 change: 1 addition & 0 deletions packages/playground/sass/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './app'
2 changes: 2 additions & 0 deletions packages/playground/sass/src/var.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$red: red;
$black: black;
14 changes: 14 additions & 0 deletions packages/playground/sass/xus.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineConfig } from '@xus/cli'

export default defineConfig({
libBuild: {
target: ['es2015'],
formats: ['esm'],
sourcemap: false,
minify: false,
css: {
cssCodeSplit: true,
injectScript: false
}
}
})
137 changes: 137 additions & 0 deletions packages/playground/sass/yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


anymatch@~3.1.1:
version "3.1.1"
resolved "https://registry.npm.taobao.org/anymatch/download/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142"
integrity sha1-xV7PAhheJGklk5kxDBc84xIzsUI=
dependencies:
normalize-path "^3.0.0"
picomatch "^2.0.4"

binary-extensions@^2.0.0:
version "2.2.0"
resolved "https://registry.npm.taobao.org/binary-extensions/download/binary-extensions-2.2.0.tgz?cache=0&sync_timestamp=1610299268308&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbinary-extensions%2Fdownload%2Fbinary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d"
integrity sha1-dfUC7q+f/eQvyYgpZFvk6na9ni0=

braces@~3.0.2:
version "3.0.2"
resolved "https://registry.npm.taobao.org/braces/download/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
integrity sha1-NFThpGLujVmeI23zNs2epPiv4Qc=
dependencies:
fill-range "^7.0.1"

"chokidar@>=2.0.0 <4.0.0":
version "3.5.1"
resolved "https://registry.npm.taobao.org/chokidar/download/chokidar-3.5.1.tgz?cache=0&sync_timestamp=1610719499558&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fchokidar%2Fdownload%2Fchokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a"
integrity sha1-7pznu+vSt59J8wR5nVRo4x4U5oo=
dependencies:
anymatch "~3.1.1"
braces "~3.0.2"
glob-parent "~5.1.0"
is-binary-path "~2.1.0"
is-glob "~4.0.1"
normalize-path "~3.0.0"
readdirp "~3.5.0"
optionalDependencies:
fsevents "~2.3.1"

fill-range@^7.0.1:
version "7.0.1"
resolved "https://registry.npm.taobao.org/fill-range/download/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
integrity sha1-GRmmp8df44ssfHflGYU12prN2kA=
dependencies:
to-regex-range "^5.0.1"

fsevents@~2.3.1:
version "2.3.2"
resolved "https://registry.npm.taobao.org/fsevents/download/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
integrity sha1-ilJveLj99GI7cJ4Ll1xSwkwC/Ro=

glob-parent@~5.1.0:
version "5.1.2"
resolved "https://registry.npm.taobao.org/glob-parent/download/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
integrity sha1-hpgyxYA0/mikCTwX3BXoNA2EAcQ=
dependencies:
is-glob "^4.0.1"

is-binary-path@~2.1.0:
version "2.1.0"
resolved "https://registry.npm.taobao.org/is-binary-path/download/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
integrity sha1-6h9/O4DwZCNug0cPhsCcJU+0Wwk=
dependencies:
binary-extensions "^2.0.0"

is-extglob@^2.1.1:
version "2.1.1"
resolved "https://registry.npm.taobao.org/is-extglob/download/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=

is-glob@^4.0.1, is-glob@~4.0.1:
version "4.0.1"
resolved "https://registry.npm.taobao.org/is-glob/download/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc"
integrity sha1-dWfb6fL14kZ7x3q4PEopSCQHpdw=
dependencies:
is-extglob "^2.1.1"

is-number@^7.0.0:
version "7.0.0"
resolved "https://registry.npm.taobao.org/is-number/download/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
integrity sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=

"js-tokens@^3.0.0 || ^4.0.0":
version "4.0.0"
resolved "https://registry.npm.taobao.org/js-tokens/download/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity sha1-GSA/tZmR35jjoocFDUZHzerzJJk=

loose-envify@^1.1.0:
version "1.4.0"
resolved "https://registry.npm.taobao.org/loose-envify/download/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
integrity sha1-ce5R+nvkyuwaY4OffmgtgTLTDK8=
dependencies:
js-tokens "^3.0.0 || ^4.0.0"

normalize-path@^3.0.0, normalize-path@~3.0.0:
version "3.0.0"
resolved "https://registry.npm.taobao.org/normalize-path/download/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
integrity sha1-Dc1p/yOhybEf0JeDFmRKA4ghamU=

object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.npm.taobao.org/object-assign/download/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=

picomatch@^2.0.4, picomatch@^2.2.1:
version "2.2.2"
resolved "https://registry.npm.taobao.org/picomatch/download/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad"
integrity sha1-IfMz6ba46v8CRo9RRupAbTRfTa0=

react@^17.0.1:
version "17.0.1"
resolved "https://registry.npm.taobao.org/react/download/react-17.0.1.tgz#6e0600416bd57574e3f86d92edba3d9008726127"
integrity sha1-bgYAQWvVdXTj+G2S7bo9kAhyYSc=
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"

readdirp@~3.5.0:
version "3.5.0"
resolved "https://registry.npm.taobao.org/readdirp/download/readdirp-3.5.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Freaddirp%2Fdownload%2Freaddirp-3.5.0.tgz#9ba74c019b15d365278d2e91bb8c48d7b4d42c9e"
integrity sha1-m6dMAZsV02UnjS6Ru4xI17TULJ4=
dependencies:
picomatch "^2.2.1"

sass@^1.32.8:
version "1.32.8"
resolved "https://registry.npm.taobao.org/sass/download/sass-1.32.8.tgz#f16a9abd8dc530add8834e506878a2808c037bdc"
integrity sha1-8WqavY3FMK3Yg05QaHiigIwDe9w=
dependencies:
chokidar ">=2.0.0 <4.0.0"

to-regex-range@^5.0.1:
version "5.0.1"
resolved "https://registry.npm.taobao.org/to-regex-range/download/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
integrity sha1-FkjESq58jZiKMmAY7XL1tN0DkuQ=
dependencies:
is-number "^7.0.0"

0 comments on commit 044c305

Please sign in to comment.