Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert to pnpm monorepo and introduce figma code/ui workspace separation #1

Merged
merged 181 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
181 commits
Select commit Hold shift + click to select a range
e8dc84f
Show simple UI
MiguelFranken Feb 25, 2024
283a89b
Add Vue and Vite bundler
MiguelFranken Feb 25, 2024
0c9b378
Send simple message from code to ui
MiguelFranken Feb 25, 2024
a6d4874
Transmit generated html to UI
MiguelFranken Feb 25, 2024
02b09c0
Add code highlighting
MiguelFranken Feb 25, 2024
085440b
Add UnoCSS support
MiguelFranken Feb 25, 2024
9a8bcae
Transform to turbo monorepo
MiguelFranken Feb 25, 2024
77e8c82
Exclude output directories
MiguelFranken Feb 25, 2024
ea4b751
Adapt README.md
MiguelFranken Feb 25, 2024
b49071b
Remove tslib root dev dep
MiguelFranken Feb 25, 2024
ca6fe19
Remove main entry in root package.json file
MiguelFranken Feb 25, 2024
8eb7904
Fix names of script in root package.json
MiguelFranken Feb 25, 2024
e4b36c9
Add `turbo clean`
MiguelFranken Feb 25, 2024
d5e8c96
Add `turbo test`
MiguelFranken Feb 25, 2024
d349157
Add tailwind reset css
MiguelFranken Feb 25, 2024
33a17ba
Set to full size in ui window
MiguelFranken Feb 25, 2024
4d4d842
Make code highlighting scrollable
MiguelFranken Feb 25, 2024
d4fa652
Add utils file
MiguelFranken Feb 25, 2024
ecd0fd3
USe typescript for main file and move index.html to package root
MiguelFranken Feb 25, 2024
cec8632
Use typescript for vite config in UI package
MiguelFranken Feb 25, 2024
85818d7
Fix manifest
MiguelFranken Feb 25, 2024
40fadfa
Refactor components
MiguelFranken Feb 25, 2024
cc9fa7b
Change code language to vue-html for highlighting
MiguelFranken Feb 25, 2024
f731ad5
Make heading bolder
MiguelFranken Feb 25, 2024
99401f9
Use Figma colors for background and text
MiguelFranken Feb 25, 2024
68d4c2e
Style the code block
MiguelFranken Feb 25, 2024
3fec983
Refactor component set processor
MiguelFranken Feb 25, 2024
2b13162
Allow component set processor to handle multiple selected nodes
MiguelFranken Feb 25, 2024
71865e0
Add notification messages when something unexpected happened
MiguelFranken Feb 25, 2024
cd3eb28
Load main component during icon creation async
MiguelFranken Feb 25, 2024
be641c2
Handle deselection of nodes in UI
MiguelFranken Feb 25, 2024
984565d
Add shared interfaces for plugin messages
MiguelFranken Feb 25, 2024
88fa349
Optimize the types
MiguelFranken Feb 25, 2024
f0c80a6
Fix color of divider in light mode
MiguelFranken Feb 26, 2024
d57b0c5
Refactor generate method in main code script
MiguelFranken Feb 26, 2024
b6872f2
Generate also for the initially selected node
MiguelFranken Feb 26, 2024
edb20b1
Refactor and move generate and messages in code package
MiguelFranken Feb 26, 2024
1055f1a
Add error message when variantTrees array is empty
MiguelFranken Feb 26, 2024
ff18976
Allow the default state for variant merging to be other states than '…
MiguelFranken Feb 26, 2024
3726978
Create default state during permutation calculation when no component…
MiguelFranken Feb 26, 2024
7c9f7d5
Fix rendering of code block for very large generated code
MiguelFranken Feb 26, 2024
0a3650a
Use function properties in merge types
MiguelFranken Feb 26, 2024
a2e6096
Early return when no states have been found in component set processor
MiguelFranken Feb 26, 2024
4e130fb
Add util to print objects that contain sets
MiguelFranken Feb 26, 2024
be08da1
Optimize css union and diff operations when a root variant is specified
MiguelFranken Feb 26, 2024
545cc46
Add more union tests
MiguelFranken Feb 26, 2024
9c613b0
Fix passing the root variant name during union calculation
MiguelFranken Feb 26, 2024
055b0b1
Add documentation
MiguelFranken Feb 26, 2024
6309cfc
Load correct theme based on light/dark mode config from Figma
MiguelFranken Feb 26, 2024
bd7b76f
Add CSS traverser for non default state in collected states
MiguelFranken Feb 26, 2024
0c0157c
Handle variant trees in default order during merging variant trees
MiguelFranken Feb 26, 2024
ce6d288
Optimize printing of debug console log of variant trees before merging
MiguelFranken Feb 26, 2024
b3ea3c9
Fix mapping of state to component for permutation
MiguelFranken Feb 26, 2024
42ba99d
Add dynamic CSS object generation for icon nodes
MiguelFranken Feb 26, 2024
5430044
Extract type definitions to a separate file
MiguelFranken Feb 26, 2024
062f5e9
Refactor component-set-processor for better error handling
MiguelFranken Feb 26, 2024
8e4e147
Rebranding to name `Onyx`
MiguelFranken Feb 26, 2024
1486e18
Eslint fix
MiguelFranken Feb 26, 2024
3a2bc05
Enable typescript and vue in eslint config
MiguelFranken Feb 27, 2024
54192e7
Apply eslint fixes
MiguelFranken Feb 27, 2024
725861b
Enable yaml eslint feature
MiguelFranken Feb 27, 2024
4e7beb9
Add github ci workflow
MiguelFranken Feb 27, 2024
8b07a16
Use correct pipeline actions
MiguelFranken Feb 27, 2024
28385b1
Do not start vitest with UI mode
MiguelFranken Feb 27, 2024
62b59d7
Add documentation
MiguelFranken Feb 27, 2024
eef1939
Refactor variant key generation in component set processor
MiguelFranken Feb 27, 2024
3b06035
Refactor script-setup generator in code package
MiguelFranken Feb 27, 2024
d2d132b
Refactor HTML generation to consider variant permutations
MiguelFranken Feb 27, 2024
eea76db
Add computed properties to script setup generator
MiguelFranken Feb 27, 2024
f8f2735
Add documentation to computed properties calculation to script setup …
MiguelFranken Feb 27, 2024
c759601
Refactor script-setup generator for clarity and efficiency
MiguelFranken Feb 27, 2024
d14ec53
Refactor ScriptSetupGenerator to accept permutations in constructor
MiguelFranken Feb 27, 2024
b2c41ec
Enhance ScriptSetupGenerator with detailed comments
MiguelFranken Feb 27, 2024
47db3ef
Refactor ScriptSetupGenerator constructor in script-setup
MiguelFranken Feb 27, 2024
0c97c42
Refactor component set processor to use VueGenerator
MiguelFranken Feb 27, 2024
a3235bd
Remove indent parameter from composeFinalScript function
MiguelFranken Feb 27, 2024
b43a39a
Implement toPascalCase utility function
MiguelFranken Feb 27, 2024
1ee3b04
Refactor type declarations to improve code organization
MiguelFranken Feb 27, 2024
6d12f86
Refactor Vue code generators for improved typing
MiguelFranken Feb 27, 2024
570ccef
Update attribute value handling in html.generator.ts
MiguelFranken Feb 27, 2024
69a1daf
Add wrapper to Vue HTML code generation
MiguelFranken Feb 27, 2024
fc07465
Refine script generation in Vue generator
MiguelFranken Feb 27, 2024
1bdf4e0
Refactor HTML generator to handle multiple permutations
MiguelFranken Feb 27, 2024
10f7c13
Add toRefs usage in script-setup generator
MiguelFranken Feb 27, 2024
985643b
Extract RectSides and RectCorners interfaces to types file
MiguelFranken Feb 27, 2024
ce16209
Implement token replacement functionality in builder
MiguelFranken Feb 27, 2024
c78c103
Add documentation
MiguelFranken Feb 27, 2024
8cc783c
Improve component properties calculation and processing
MiguelFranken Feb 27, 2024
7439e2c
Remove value count tracking from component property retrieval
MiguelFranken Feb 27, 2024
a6032c2
Update console.log messages in constructors
MiguelFranken Feb 27, 2024
1461a13
Improve default state handling and add logging
MiguelFranken Feb 27, 2024
b23df83
Add boolean check in Vue union type generator
MiguelFranken Feb 27, 2024
ddab4f2
Remove extra space in HTML generator conditions
MiguelFranken Feb 27, 2024
4dc1137
WIP
MiguelFranken Feb 27, 2024
fbc3427
Show selected node ids in UI
MiguelFranken Feb 28, 2024
5d1d9e4
Transmit component props to UI
MiguelFranken Feb 28, 2024
8670942
Increase padding to bottom
MiguelFranken Feb 28, 2024
177ea25
Show selected nodes for component sets as well
MiguelFranken Feb 28, 2024
b63b8a1
Add documentation
MiguelFranken Feb 29, 2024
5fe67e2
Update UI element visibility and style
MiguelFranken Feb 29, 2024
132f2e6
Add variant visualization in UI component
MiguelFranken Feb 29, 2024
fe3dc82
Update UI table presentation
MiguelFranken Feb 29, 2024
bd54dcb
Add Builder class to generate CSS classes from node attributes
MiguelFranken Feb 29, 2024
943632f
Refactor interfaces and types into separate file
MiguelFranken Feb 29, 2024
2ae9c92
Add Configuration UI with Select Component
MiguelFranken Feb 29, 2024
8ac54cf
Implement icon import from Figma and enhance UI component styles
MiguelFranken Feb 29, 2024
fee5fa3
Refactor select component for custom options
MiguelFranken Feb 29, 2024
d21eae8
Refactor code by replacing @onyx/events with @onyx/types
MiguelFranken Feb 29, 2024
da34e8f
Implement config mode and mode change event handling
MiguelFranken Feb 29, 2024
c8331d0
Remove unused isIndividualStrokesMixin function
MiguelFranken Feb 29, 2024
728edda
Add support for variable utility values in builder
MiguelFranken Feb 29, 2024
d35d4df
Refactor stroke color handling in builder
MiguelFranken Feb 29, 2024
7ae79a2
Implement color inferencing in builder
MiguelFranken Feb 29, 2024
2cea5d0
Add nearestColor inference to color builder
MiguelFranken Feb 29, 2024
3c34064
Add "Nearest Color" switch to UI
MiguelFranken Feb 29, 2024
2b14d98
Add NearestColorChanged event handling
MiguelFranken Feb 29, 2024
47bb030
Implement caching for nearest color lookups
MiguelFranken Feb 29, 2024
17e51bd
Add documentation
MiguelFranken Feb 29, 2024
f7da3e1
Add tests for findNearestColor function
MiguelFranken Feb 29, 2024
d1f2884
Refactor nearest color inference to generic nearest inference
MiguelFranken Feb 29, 2024
5fb1270
Fix z-index of select component
MiguelFranken Feb 29, 2024
2f7a745
Add margin to nearest inference switch
MiguelFranken Feb 29, 2024
bcafcf8
Better layout for configuration components
MiguelFranken Feb 29, 2024
b8e0f2a
Fix color conversion in findNearestColor
MiguelFranken Feb 29, 2024
9f16491
Add variant group change functionality
MiguelFranken Feb 29, 2024
11bdee0
Update translateVariantCSS function to handle variant groups
MiguelFranken Feb 29, 2024
7d554a2
Refactor UI layout structure and restyle
MiguelFranken Feb 29, 2024
a9f7dc5
Update divider color code in UI component
MiguelFranken Feb 29, 2024
0ee36ed
Update Onyx header styling in ui.vue
MiguelFranken Mar 1, 2024
2d2fe99
Update package lock
MiguelFranken Mar 1, 2024
acd22d1
Add codegen scripts as dependency for build and dev tasks
MiguelFranken Mar 1, 2024
5bedd5c
Fix layout when no node is selected
MiguelFranken Mar 1, 2024
3d939bc
Fix code divider color in light mode
MiguelFranken Mar 1, 2024
c68be18
Add copy to clipboard stub functionality
MiguelFranken Mar 1, 2024
74cd5c8
Refactor code component and add copy functionality
MiguelFranken Mar 1, 2024
88c485f
Add code container background and box-shadow styles when copy button …
MiguelFranken Mar 1, 2024
d778db3
Fix background and text colors inside select overlay
MiguelFranken Mar 1, 2024
985d840
Refactor directory structure in ui package
MiguelFranken Mar 1, 2024
8f7defc
Remove redundant file
MiguelFranken Mar 1, 2024
2526f22
Add usePluginMessage store
MiguelFranken Mar 1, 2024
874ecaa
Add event bus to code package for better type support when listening …
MiguelFranken Mar 1, 2024
30525a1
Fix file name of dimension-map.ts
MiguelFranken Mar 1, 2024
923baea
Refactor position of inference code
MiguelFranken Mar 1, 2024
5c832dd
Add inference unit tests
MiguelFranken Mar 1, 2024
337e2ec
Use unocss preset for color and dimension calculation
MiguelFranken Mar 3, 2024
e62d4c0
Use auto layout builder
MiguelFranken Mar 4, 2024
e5121c3
Refactor builder methods
MiguelFranken Mar 4, 2024
8d4a88d
Refactor utility inference method
MiguelFranken Mar 4, 2024
809119f
Refactor getInferredDimension method
MiguelFranken Mar 4, 2024
22aa6f9
Refactor getUtilityClass in AutoLayoutBuilder
MiguelFranken Mar 4, 2024
fec0bda
Add unit switch functionality
MiguelFranken Mar 4, 2024
5b92e75
Remove unnecessary variable in findNearestDimension
MiguelFranken Mar 4, 2024
76e9f13
Use class utility calculator in standard builder
MiguelFranken Mar 4, 2024
7827f9b
Use class utility calculator in buildMinimalFillsMixin
MiguelFranken Mar 4, 2024
92e1ce6
Remove console logs in main code module
MiguelFranken Mar 4, 2024
8a25ea2
Refactor component structure in UI
MiguelFranken Mar 4, 2024
4d8bb1f
Fix frontend selection component visibility
MiguelFranken Mar 4, 2024
2731fff
Add try/catch around generate method
MiguelFranken Mar 4, 2024
1de1b88
Fix component prop calculation when no props are specified for a comp…
MiguelFranken Mar 4, 2024
647ddab
Remove console logs
MiguelFranken Mar 4, 2024
ffed1a5
Add function createDimensionLookupPx
MiguelFranken Mar 4, 2024
44bfcc9
Add better configuration loading in frontend
MiguelFranken Mar 5, 2024
27debe7
Refactor main css loading
MiguelFranken Mar 5, 2024
5b9cef3
Refactor directory structure of vue components
MiguelFranken Mar 5, 2024
4c1e47d
Refactor font tokens in unocss config
MiguelFranken Mar 5, 2024
73100b9
Add custom font size xs definition
MiguelFranken Mar 5, 2024
1b0bae7
Fix scrolling in code container
MiguelFranken Mar 5, 2024
ff8c15c
Fix tests
MiguelFranken Mar 5, 2024
3e259bf
Refactor configuration passing
MiguelFranken Mar 7, 2024
e0b5f5f
Add loading spinner during code generation
MiguelFranken Mar 7, 2024
7b7a7f4
Show execution time under code component
MiguelFranken Mar 7, 2024
072e7e7
Load instance swap nodes async
MiguelFranken Mar 7, 2024
5d76df8
Exclude .turbo directory
MiguelFranken Mar 7, 2024
4c57fc1
Remove console.log
MiguelFranken Mar 7, 2024
bf2ce11
Fix px/rem position in configuration vue component
MiguelFranken Mar 7, 2024
ce6a60b
Fix use nearest inference when value is exactly in the map
MiguelFranken Mar 7, 2024
c55198e
Build font styles
MiguelFranken Mar 7, 2024
07776fb
Use secret in github ci pipeline
MiguelFranken Mar 9, 2024
b34e38d
Use vars in github ci pipeline
MiguelFranken Mar 9, 2024
4ce2139
Rename checkout step in github ci pipeline
MiguelFranken Mar 9, 2024
705bf73
Eslint fix
MiguelFranken Mar 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm

- name: Install Dependencies
run: pnpm install

- name: Lint
run: pnpm run lint
continue-on-error: true

- name: Build
run: pnpm build
env:
FIGMA_PERSONAL_ACCESS_TOKEN: ${{ secrets.FIGMA_PERSONAL_ACCESS_TOKEN }}
FIGMA_FILE: ${{ vars.FIGMA_FILE }}
FIGMA_USE_CACHE: ${{ vars.FIGMA_USE_CACHE }}

- name: Test
run: pnpm test
42 changes: 38 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,41 @@
# Node
*.log
*.log.*
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Dependencies
node_modules
.pnp
.pnp.js

# Local env files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Testing
coverage

# Turbo
.turbo

# Vercel
.vercel

# Build Outputs
.next/
out/
dist/
build
dist


# Debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Misc
.DS_Store
*.pem

# Cache
.cache
1 change: 1 addition & 0 deletions .idea/jsLinters/eslint.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/unocss-variables.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"eslint.workingDirectories": [
{
"mode": "auto"
}
]
}
44 changes: 5 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,6 @@
Below are the steps to get your plugin running. You can also find instructions at:
# Onyx Figma Plugin

https://www.figma.com/plugin-docs/plugin-quickstart-guide/

This plugin template uses Typescript and NPM, two standard tools in creating JavaScript applications.

First, download Node.js which comes with NPM. This will allow you to install TypeScript and other
libraries. You can find the download link here:

https://nodejs.org/en/download/

Next, install TypeScript using the command:

npm install -g typescript

Finally, in the directory of your plugin, get the latest type definitions for the plugin API by running:

npm install --save-dev @figma/plugin-typings

If you are familiar with JavaScript, TypeScript will look very familiar. In fact, valid JavaScript code
is already valid Typescript code.

TypeScript adds type annotations to variables. This allows code editors such as Visual Studio Code
to provide information about the Figma API while you are writing code, as well as help catch bugs
you previously didn't notice.

For more information, visit https://www.typescriptlang.org/

Using TypeScript requires a compiler to convert TypeScript (code.ts) into JavaScript (code.js)
for the browser to run.

We recommend writing TypeScript code using Visual Studio code:

1. Download Visual Studio Code if you haven't already: https://code.visualstudio.com/.
2. Open this directory in Visual Studio Code.
3. Compile TypeScript to JavaScript: Run the "Terminal > Run Build Task..." menu item,
then select "npm: watch". You will have to do this again every time
you reopen Visual Studio Code.

That's it! Visual Studio Code will regenerate the JavaScript file every time you save.
```shell
pnpm install
pnpm build
```
3 changes: 3 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ import antfu from '@antfu/eslint-config'

export default antfu({
rules: { 'no-console': 'off' },
typescript: true,
vue: true,
yaml: true,
})
14 changes: 5 additions & 9 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
{
"name": "unocss-variables",
"name": "onyx",
"id": "1331160444558094836",
"api": "1.0.0",
"main": "dist/bundle.js",
"ui": "packages/ui/dist/index.html",
"main": "packages/code/dist/code.js",
"capabilities": [
"codegen"
"inspect"
],
"enableProposedApi": false,
"documentAccess": "dynamic-page",
"editorType": [
"dev"
],
"codegenLanguages": [
{
"label": "Language Label",
"value": "language-value"
}
],
"networkAccess": {
"allowedDomains": [
"none"
Expand Down
42 changes: 16 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,26 @@
{
"name": "unocss-variables",
"name": "onyx",
"type": "module",
"version": "1.0.0",
"private": "true",
"packageManager": "[email protected]",
"description": "Your Figma Plugin",
"author": "",
"license": "",
"main": "code.js",
"author": "Miguel Franken",
"license": "MIT",
"engines": {
"node": ">=20"
},
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
"clean": "rm -rf dist",
"typecheck": "tsc --noEmit",
"build": "turbo build",
"dev": "turbo dev",
"test": "turbo test",
"clean": "turbo clean",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"test": "vitest --ui"
"lint:fix": "eslint . --fix"
},
"devDependencies": {
"@antfu/eslint-config": "^2.6.3",
"@figma/plugin-typings": "^1.84.0",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@types/lodash-es": "^4.17.12",
"@vitest/ui": "^1.2.1",
"eslint": "^8.56.0",
"rollup": "^4.9.6",
"tslib": "^2.6.2",
"typescript": "^5.3.3",
"vitest": "^1.2.1"
},
"dependencies": {
"lodash-es": "^4.17.21"
"@antfu/eslint-config": "^2.6.4",
"eslint": "^8.57.0",
"turbo": "^1.12.4"
}
}
35 changes: 35 additions & 0 deletions packages/code/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "@onyx/code",
"type": "module",
"version": "0.0.0",
"private": true,
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
"clean": "rm -rf dist",
"test": "vitest"
},
"dependencies": {
"@unocss/preset-mini": "^0.58.5",
"defu": "^6.1.4",
"lodash-es": "^4.17.21"
},
"devDependencies": {
"@babel/core": "^7.24.0",
"@babel/preset-env": "^7.24.0",
"@figma/plugin-typings": "^1.87.0",
"@onyx/tsconfig": "workspace:^",
"@onyx/types": "workspace:^",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@types/lodash-es": "^4.17.12",
"@vitest/ui": "^1.3.1",
"rollup": "^4.12.0",
"tslib": "^2.6.2",
"typescript": "^5.3.3",
"vitest": "^1.3.1"
}
}
6 changes: 5 additions & 1 deletion rollup.config.js → packages/code/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import typescript from '@rollup/plugin-typescript'
import commonjs from '@rollup/plugin-commonjs'
import resolve from '@rollup/plugin-node-resolve'
import terser from '@rollup/plugin-terser'
import { getBabelOutputPlugin } from '@rollup/plugin-babel'

const production = !process.env.ROLLUP_WATCH

Expand All @@ -15,7 +16,7 @@ const config = {
output: {
format: `cjs`,
name: `code`,
file: `dist/bundle.js`,
file: `dist/code.js`,
},

plugins: [
Expand All @@ -24,6 +25,9 @@ const config = {
resolve({
browser: true,
}),
getBabelOutputPlugin({
presets: ['@babel/preset-env'],
}),
production && terser(),
],
}
Expand Down
Loading