12 |
`
24 | );
25 | });
26 | });
27 |
--------------------------------------------------------------------------------
/test/sgds-web-component.ts:
--------------------------------------------------------------------------------
1 | import "../src/index";
2 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2017",
4 | "module": "esnext",
5 | "moduleResolution": "node",
6 | "lib": ["es2017", "dom", "dom.iterable"],
7 | "declaration": true,
8 | "declarationDir": "lib",
9 | "sourceMap": true,
10 | "experimentalDecorators": true,
11 | "inlineSources": true,
12 | "skipLibCheck": true,
13 | "noImplicitAny": false,
14 | "importHelpers": true,
15 | "rootDir": "src",
16 | "allowJs": true,
17 | "typeRoots": ["./src/typings", "./node_modules/@types"]
18 | },
19 | "include": ["**/*.ts", "typings"],
20 | "exclude": ["node_modules", "lib", "test", "test-outdir", "mocks", "react", "cypress", "cypress.config.ts"]
21 | }
22 |
--------------------------------------------------------------------------------
/tsconfig.test.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "allowSyntheticDefaultImports": true,
5 | "rootDir": "."
6 | },
7 | "include": ["**/*.ts", "./mocks/*.ts"],
8 | "exclude": ["node_modules", "lib", "src", "cypress", "cypress.config.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/typings/css.d.ts:
--------------------------------------------------------------------------------
1 | declare module "*.css" {
2 | import { CSSResult } from "lit";
3 | const styles: CSSResult;
4 | export default styles;
5 | }
6 |
--------------------------------------------------------------------------------
/vite.config.js:
--------------------------------------------------------------------------------
1 | import { defineConfig, createLogger } from "vite";
2 | import postcssLit from "rollup-plugin-postcss-lit";
3 | import replace from "@rollup/plugin-replace";
4 |
5 | const logger = createLogger();
6 | const originalWarning = logger.warn;
7 | logger.warn = (msg, options) => {
8 | if (msg.includes("Default and named imports from CSS files are deprecated")) return;
9 | originalWarning(msg, options);
10 | };
11 |
12 | export default defineConfig({
13 | plugins: [
14 | replace({
15 | ".css": ".css?inline",
16 | preventAssignment: true
17 | }),
18 | postcssLit({ include: ["**/*.css", "**/*.css?*"] })
19 | ],
20 | resolve: {
21 | alias: [
22 | {
23 | // this is required for the SCSS modules
24 | find: /^~(.*)$/,
25 | replacement: "$1"
26 | }
27 | ]
28 | },
29 | define: {
30 | "process.env.VITE_ENV": JSON.stringify(process.env.VITE_ENV)
31 | },
32 | customLogger: logger,
33 | build: {
34 | cssCodeSplit: false
35 | }
36 | });
37 |
--------------------------------------------------------------------------------