-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
176 additions
and
62 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// babel.config.js (ES Modules Format) | ||
// Babel configuration for compiling JavaScript code | ||
|
||
export const presets = [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
// Enables transformation of ES6+ syntax to ES5 | ||
loose: true, // Enable "loose" transformations for any plugins in this preset that allow them | ||
bugfixes: true, // Enable bugfixes that allow Babel to produce smaller output in some cases | ||
// modules: true // Preserve ES modules. Set to false to not transform modules, or specify a module type | ||
modules: false // Preserve ES modules. Set to false to not transform modules, or specify a module type | ||
} | ||
] | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "unit.gl", | ||
"description": "", | ||
"description": "A Sass-based layout engine for fluid typography and responsive design, utilizing the Kyu unit measurement system.", | ||
"version": "0.0.1", | ||
"config": { | ||
"version_short": "0.0" | ||
|
@@ -20,9 +20,9 @@ | |
"web" | ||
], | ||
"homepage": "https://www.unit.gl/", | ||
"author": "Lars van Vianen", | ||
"author": "Lars van Vianen <[email protected]> (https://vianen.com)", | ||
"contributors": [ | ||
"Scape Agency" | ||
"Scape Agency <[email protected]>" | ||
], | ||
"license": "Apache-2.0", | ||
"repository": { | ||
|
@@ -40,9 +40,9 @@ | |
], | ||
"main": "src/scss/index.scss", | ||
"type": "module", | ||
"module": "", | ||
"sass": "", | ||
"style": "", | ||
"module": "dist/js/unit.gl.js", | ||
"style": "dist/css/unit.gl.css", | ||
"sass": "src/scss/index.scss", | ||
"scripts": { | ||
"format": "npx prettier --write .", | ||
"lint": "eslint 'src/**/*.ts' || true", | ||
|
@@ -97,8 +97,10 @@ | |
}, | ||
"jspm": { | ||
"registry": "npm", | ||
"main": "", | ||
"directories": {}, | ||
"main": "dist/js/unit.gl.js", | ||
"directories": { | ||
"lib": "src" | ||
}, | ||
"shim": {}, | ||
"dependencies": {}, | ||
"peerDependencies": {} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
body { | ||
font-family: 'Arial', sans-serif; | ||
margin: 0; | ||
padding: 20px; | ||
background-color: #f0f0f0; | ||
color: #333; | ||
|
||
h1 { | ||
color: navy; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,37 @@ | ||
// webpack.config.js | ||
|
||
// Import necessary dependencies and configuration files | ||
import { merge } from "webpack-merge"; | ||
import configCommon from "./webpack.common.js"; | ||
import configDevelopment from "./webpack.dev.js"; | ||
import configProduction from "./webpack.prod.js"; | ||
|
||
|
||
// Config | Merge | ||
export const config = (env, args) => { | ||
switch(args.mode) { | ||
case "development": | ||
/** | ||
* Merge Webpack Configuration | ||
* | ||
* Merges the common configuration with environment-specific configurations | ||
* based on the build mode (development or production). | ||
* | ||
* @param {object} env - The environment variables passed to the Webpack configuration. | ||
* @param {object} args - Arguments and options passed via the command line or scripts. | ||
* @return {object} - The merged Webpack configuration object. | ||
* @throws {Error} - Throws an error if an invalid build mode is specified. | ||
*/ | ||
// export const config = (env, args) => { | ||
const config = (env, args) => { | ||
switch (args.mode) { | ||
case 'development': | ||
console.info('Merging common configuration with development settings...'); | ||
return merge(configCommon, configDevelopment); | ||
case "production": | ||
|
||
case 'production': | ||
console.info('Merging common configuration with production settings...'); | ||
return merge(configCommon, configProduction); | ||
|
||
default: | ||
throw new Error("No matching configuration was found!"); | ||
throw new Error('No matching configuration was found! Please specify "development" or "production" mode.'); | ||
} | ||
} | ||
|
||
}; | ||
|
||
// Config | Export | ||
export default config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.