Skip to content

Commit

Permalink
Improved dist
Browse files Browse the repository at this point in the history
  • Loading branch information
msarca committed Apr 8, 2022
1 parent 995837c commit 08874ae
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 12 deletions.
3 changes: 0 additions & 3 deletions dist/assembler.cjs.js

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

3 changes: 0 additions & 3 deletions dist/assembler.es.js

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

1 change: 1 addition & 0 deletions dist/assembler.js

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

5 changes: 3 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import pkg from './package.json';

const NAME = 'AssemblerCSS';
const MAIN = 'src/index.ts';
const AUTOLOAD = 'src/autoload.ts';
const GLOBALS = {};
const EXTERNAL = Object.keys(GLOBALS);

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

const CONFIG = [
{
input: MAIN,
input: AUTOLOAD,
output: {
name: NAME,
file: pkg.browser,
Expand All @@ -32,7 +33,7 @@ const CONFIG = [
if (production) {
CONFIG.push(...[
{
input: MAIN,
input: AUTOLOAD,
output: {
name: NAME,
file: pkg.browser.replace('.js', '.min.js'),
Expand Down
22 changes: 22 additions & 0 deletions src/autoload.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright 2022 Zindex Software
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import {init} from "./index";
export * from "./index";

if (typeof window !== 'undefined') {
init();
}
4 changes: 0 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,3 @@ export function cssStyleSheet(): CSSStyleSheet {
return styleHandler.style;
}

if (typeof window !== 'undefined') {
init();
}

1 change: 1 addition & 0 deletions types/autoload.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./index";

0 comments on commit 08874ae

Please sign in to comment.