Skip to content

Commit

Permalink
test: add cases
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed Mar 18, 2024
1 parent faee1b8 commit f6e16b5
Show file tree
Hide file tree
Showing 22 changed files with 360 additions and 10 deletions.
3 changes: 3 additions & 0 deletions playground/concatenate-modules/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# concatenate modules

The scope of all modules should be concatenated into one closure.
3 changes: 3 additions & 0 deletions playground/concatenate-modules/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default num = 0
export const num1 = 1
export const num2 = 2
2 changes: 2 additions & 0 deletions playground/concatenate-modules/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './lib'
export { num } from './constants'
11 changes: 11 additions & 0 deletions playground/concatenate-modules/lib.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import num, { num1, num2 } from './constants'

export function add1() {
return num + num1
}

export function add2() {
return num + num2
}

export { num1 }
3 changes: 3 additions & 0 deletions playground/css/button.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.button {
background-color: azure;
}
7 changes: 7 additions & 0 deletions playground/css/button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import './button.css'

export const renderButton = () => {
const button = document.createElement('button')
button.className = 'button theme-button'
return button
}
3 changes: 3 additions & 0 deletions playground/css/css/theme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.theme-button {
padding: 1rem;
}
2 changes: 2 additions & 0 deletions playground/css/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import foo from './foo'
export default foo
7 changes: 7 additions & 0 deletions playground/css/less/index.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@width: 10px;
@height: @width + 10px;

.button {
width: @width;
height: @height;
}
10 changes: 10 additions & 0 deletions playground/css/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "@rslib/test-css",
"private": true,
"version": "0.0.0",
"type": "module",
"devDependencies": {
"less": "^4.2.0",
"sass": "^1.72.0"
}
}
7 changes: 7 additions & 0 deletions playground/css/sass/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
$font-stack: Helvetica, sans-serif;
$primary-color: #333;

.button {
font: 100% $font-stack;
color: $primary-color;
}
1 change: 1 addition & 0 deletions playground/esm/foo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default 'foo'
2 changes: 2 additions & 0 deletions playground/esm/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import foo from './foo'
export { foo }
3 changes: 3 additions & 0 deletions playground/external/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# external

`react` should not be bundled.
7 changes: 7 additions & 0 deletions playground/external/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react'

const Button = ({ children }) => {
return <button>{children}</button>
}

export default Button
Empty file added playground/svelte/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions playground/ts-with-ts-extension/foo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default 'foo'
2 changes: 2 additions & 0 deletions playground/ts-with-ts-extension/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import foo from './foo.ts'
export { foo }
1 change: 1 addition & 0 deletions playground/ts/foo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default 'foo'
2 changes: 2 additions & 0 deletions playground/ts/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import foo from './foo'
export { foo }
Empty file added playground/vue/.gitkeep
Empty file.
Loading

0 comments on commit f6e16b5

Please sign in to comment.