Skip to content

Commit 08874ae

Browse files
committed
Improved dist
1 parent 995837c commit 08874ae

File tree

7 files changed

+27
-12
lines changed

7 files changed

+27
-12
lines changed

dist/assembler.cjs.js

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/assembler.es.js

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/assembler.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rollup.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import pkg from './package.json';
55

66
const NAME = 'AssemblerCSS';
77
const MAIN = 'src/index.ts';
8+
const AUTOLOAD = 'src/autoload.ts';
89
const GLOBALS = {};
910
const EXTERNAL = Object.keys(GLOBALS);
1011

@@ -17,7 +18,7 @@ const typescript = ts({
1718

1819
const CONFIG = [
1920
{
20-
input: MAIN,
21+
input: AUTOLOAD,
2122
output: {
2223
name: NAME,
2324
file: pkg.browser,
@@ -32,7 +33,7 @@ const CONFIG = [
3233
if (production) {
3334
CONFIG.push(...[
3435
{
35-
input: MAIN,
36+
input: AUTOLOAD,
3637
output: {
3738
name: NAME,
3839
file: pkg.browser.replace('.js', '.min.js'),

src/autoload.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright 2022 Zindex Software
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import {init} from "./index";
18+
export * from "./index";
19+
20+
if (typeof window !== 'undefined') {
21+
init();
22+
}

src/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,3 @@ export function cssStyleSheet(): CSSStyleSheet {
120120
return styleHandler.style;
121121
}
122122

123-
if (typeof window !== 'undefined') {
124-
init();
125-
}
126-

types/autoload.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./index";

0 commit comments

Comments
 (0)