move config dir into src
This commit is contained in:
parent
2dda9d76a4
commit
e92a2c3424
34
gulpfile.mjs
34
gulpfile.mjs
@ -3,19 +3,19 @@
|
|||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra';
|
||||||
import gulp from 'gulp'
|
import gulp from 'gulp';
|
||||||
import sass from 'gulp-dart-sass'
|
import sass from 'gulp-dart-sass';
|
||||||
import sourcemaps from 'gulp-sourcemaps'
|
import sourcemaps from 'gulp-sourcemaps';
|
||||||
import path from 'node:path'
|
import path from 'node:path';
|
||||||
import buffer from 'vinyl-buffer'
|
import buffer from 'vinyl-buffer';
|
||||||
import source from 'vinyl-source-stream'
|
import source from 'vinyl-source-stream';
|
||||||
import yargs from 'yargs'
|
import yargs from 'yargs';
|
||||||
import { hideBin } from 'yargs/helpers'
|
import { hideBin } from 'yargs/helpers';
|
||||||
|
|
||||||
import rollupStream from '@rollup/stream'
|
import rollupStream from '@rollup/stream';
|
||||||
|
|
||||||
import rollupConfig from './rollup.config.mjs'
|
import rollupConfig from './rollup.config.mjs';
|
||||||
|
|
||||||
/********************/
|
/********************/
|
||||||
/* CONFIGURATION */
|
/* CONFIGURATION */
|
||||||
@ -27,8 +27,8 @@ const distDirectory = './dist';
|
|||||||
const stylesDirectory = `${sourceDirectory}/styles`;
|
const stylesDirectory = `${sourceDirectory}/styles`;
|
||||||
const stylesExtension = 'scss';
|
const stylesExtension = 'scss';
|
||||||
const sourceFileExtension = 'js';
|
const sourceFileExtension = 'js';
|
||||||
const staticFiles = ['assets', 'fonts', 'lang', 'templates'];
|
const staticFiles = ['assets', 'config', 'fonts', 'lang', 'templates'];
|
||||||
const runtimeStaticFiles = ['packs', 'module.json']
|
const runtimeStaticFiles = ['packs', 'module.json'];
|
||||||
|
|
||||||
/********************/
|
/********************/
|
||||||
/* BUILD */
|
/* BUILD */
|
||||||
@ -40,7 +40,7 @@ let cache;
|
|||||||
* Build the distributable JavaScript code
|
* Build the distributable JavaScript code
|
||||||
*/
|
*/
|
||||||
function buildCode() {
|
function buildCode() {
|
||||||
return rollupStream({...rollupConfig(), cache })
|
return rollupStream({ ...rollupConfig(), cache })
|
||||||
.on('bundle', (bundle) => {
|
.on('bundle', (bundle) => {
|
||||||
cache = bundle;
|
cache = bundle;
|
||||||
})
|
})
|
||||||
@ -135,8 +135,10 @@ function getDataPaths() {
|
|||||||
const dataPaths = Array.isArray(dataPath) ? dataPath : [dataPath];
|
const dataPaths = Array.isArray(dataPath) ? dataPath : [dataPath];
|
||||||
|
|
||||||
return dataPaths.map((dataPath) => {
|
return dataPaths.map((dataPath) => {
|
||||||
if(typeof dataPath !== 'string') {
|
if (typeof dataPath !== 'string') {
|
||||||
throw new Error(`Property dataPath in foundryconfig.json is expected to be a string or an array of strings, but found ${dataPath}`);
|
throw new Error(
|
||||||
|
`Property dataPath in foundryconfig.json is expected to be a string or an array of strings, but found ${dataPath}`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (!fs.existsSync(path.resolve(dataPath))) {
|
if (!fs.existsSync(path.resolve(dataPath))) {
|
||||||
throw new Error(`The dataPath ${dataPath} does not exist on the file system`);
|
throw new Error(`The dataPath ${dataPath} does not exist on the file system`);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user