Skip to content

Commit

Permalink
feat: Migrate to webpack Asset Modules
Browse files Browse the repository at this point in the history
  • Loading branch information
mvsde committed Aug 9, 2021
1 parent 7159cd9 commit 7f89a3b
Show file tree
Hide file tree
Showing 20 changed files with 2,126 additions and 2,728 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 15
node-version: 16
- name: Install dependencies
run: npm ci
- name: Test unit
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
15
16
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Framework for design system development with Nunjucks, Sass, and JavaScript.

Requires [Node.js 15](https://nodejs.org).
Requires [Node.js 15 or higher](https://nodejs.org).

## Create a new project with `npx`

Expand Down
10 changes: 10 additions & 0 deletions lib/generate-asset-filename.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Generate file-loader options
* @param {Object} options Options
* @param {'img'|'video'|'audio'|'font'} options.type File type
* @param {boolean|'imported'|'all'} [options.hash] Hash file names
* @returns {string} file-loader options
*/
export default function ({ type, hash }) {
return `${type}/${hash ? '[contenthash:8]' : '[name]'}[ext]`
}
12 changes: 0 additions & 12 deletions lib/generate-file-loader-options.js

This file was deleted.

2 changes: 1 addition & 1 deletion lib/generate-output-filename.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Generate output filename
* @param {Object} options Options
* @param {'js'|'css'} options.type File type
* @param {boolean|'imported'|'all'} options.hash Hash file names
* @param {boolean|'imported'|'all'} [options.hash] Hash file names
* @returns {string} File name
*/
export default function ({ type, hash }) {
Expand Down
4 changes: 2 additions & 2 deletions lib/get-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ const defaultConfig = {
/**
* Get config
* @param {Object} options Options
* @param {string} options.context Working directory
* @returns {Object} Config
* @param {string} [options.context] Working directory
* @returns {Promise<Object>} Config
*/
export default async function ({ context }) {
const pkg = await getPkg({ context })
Expand Down
2 changes: 1 addition & 1 deletion lib/get-pkg.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import path from 'path'
* Get package.json
* @param {Object} options Options
* @param {string} options.context Working directory
* @returns {Object} package.json
* @returns {Promise<Object>} package.json
*/
export default async function ({ context }) {
try {
Expand Down
Loading

0 comments on commit 7f89a3b

Please sign in to comment.