2024-09-28 13:46:01 +02:00
import path from 'node:path'
import { themes as prismThemes } from 'prism-react-renderer'
2024-09-28 13:13:48 +02:00
const config = {
title : 'FreeSewing' ,
tagline : 'An open source Javascript library for parametric sewing patterns' ,
favicon : 'img/favicon.ico' ,
url : 'https://freesewing.dev' ,
baseUrl : '/' ,
onBrokenLinks : 'throw' ,
onBrokenMarkdownLinks : 'warn' ,
/ *
* We need to make sure we can import from . mjs files
* /
plugins : [
( ) => ( {
name : 'mjs-loader' ,
2024-09-28 15:09:28 +02:00
configureWebpack ( ) {
2024-09-28 13:13:48 +02:00
return {
module : {
rules : [
{
test : /\.mjs$/ ,
include : /node_modules/ ,
2024-09-28 13:46:01 +02:00
type : 'javascript/auto' ,
2024-09-28 13:13:48 +02:00
} ,
{
test : /\.mjs$/ ,
exclude : /node_modules/ ,
use : {
loader : 'babel-loader' ,
options : {
presets : [ '@babel/preset-react' ] ,
} ,
} ,
2024-09-28 13:46:01 +02:00
} ,
] ,
} ,
2024-09-28 13:13:48 +02:00
}
2024-09-28 13:46:01 +02:00
} ,
} ) ,
( ) => ( {
name : 'fs-loader' ,
2024-09-28 15:09:28 +02:00
configureWebpack ( ) {
2024-09-28 13:46:01 +02:00
const fsConfig = {
resolve : { alias : { } } ,
}
// Load plugins from source, rather than compiled package
2024-09-28 14:16:39 +02:00
for ( const plugin of [
2024-09-28 14:20:00 +02:00
'core-plugins' ,
2024-09-28 13:46:01 +02:00
'plugin-annotations' ,
'plugin-bin-pack' ,
'plugin-bust' ,
'plugin-flip' ,
'plugin-gore' ,
'plugin-i18n' ,
'plugin-measurements' ,
'plugin-mirror' ,
'plugin-ringsector' ,
'plugin-round' ,
'plugin-sprinkle' ,
'plugin-svgattr' ,
'plugin-theme' ,
'plugin-timing' ,
'plugin-versionfree-svg' ,
] ) {
fsConfig . resolve . alias [ ` @freesewing/ ${ plugin } ` ] = path . resolve (
2024-09-28 14:09:32 +02:00
_ _dirname ,
2024-09-28 14:16:39 +02:00
` ../../plugins/ ${ plugin } /src/index.mjs `
2024-09-28 13:46:01 +02:00
)
}
// Load these from source, rather than compiled package
for ( const pkg of [ 'core' , 'i18n' , 'models' , 'snapseries' ] ) {
fsConfig . resolve . alias [ ` @freesewing/ ${ pkg } ` ] = path . resolve (
2024-09-28 14:09:32 +02:00
_ _dirname ,
2024-09-28 14:16:39 +02:00
` ../../packages/ ${ pkg } /src/index.mjs `
2024-09-28 13:46:01 +02:00
)
}
return fsConfig
} ,
2024-09-28 13:13:48 +02:00
} ) ,
] ,
i18n : { defaultLocale : 'en' , locales : [ 'en' ] } ,
presets : [
[
'classic' ,
2024-09-28 13:46:01 +02:00
{
2024-09-28 13:13:48 +02:00
docs : {
routeBasePath : '/' ,
sidebarPath : './sidebars.js' ,
2025-04-03 16:38:48 +00:00
editUrl : 'https://codeberg.com/freesewing/freesewing/tree/develop/sites/dev/' ,
2024-09-28 13:13:48 +02:00
} ,
theme : {
customCss : './src/css/custom.css' ,
} ,
2024-09-28 13:46:01 +02:00
} ,
] ,
2024-09-28 13:13:48 +02:00
] ,
2024-09-28 13:46:01 +02:00
themeConfig : {
2024-10-12 17:18:13 +02:00
algolia : {
appId : 'VBV9JOCO5C' ,
apiKey : '663aefa13d332c45801dc32d9d5ea718' ,
indexName : 'freesewing' ,
} ,
2024-09-28 18:28:56 +02:00
image : 'img/freesewing-social-card.png' ,
2024-09-28 13:46:01 +02:00
navbar : {
title : 'FreeSewing.dev' ,
logo : {
alt : 'FreeSewing Logo' ,
src : 'img/logo-white.svg' ,
2024-09-28 13:13:48 +02:00
} ,
2024-09-28 13:46:01 +02:00
items : [
{ to : '/guides' , label : 'Guides' , position : 'left' } ,
{ to : '/howtos' , label : 'Howtos' , position : 'left' } ,
{ to : '/reference' , label : 'Reference' , position : 'left' } ,
{ to : '/tutorials' , label : 'Tutorials' , position : 'left' } ,
{
href : 'https://freesewing.org/' ,
label : 'FreeSewing.org' ,
position : 'right' ,
} ,
] ,
} ,
footer : {
style : 'light' ,
links : [
{
title : 'Docs' ,
items : [
{ label : 'Guides' , to : '/guides' } ,
{ label : 'Howtos' , to : '/howtos' } ,
{ label : 'Reference' , to : '/reference' } ,
{ label : 'Tutorials' , to : '/tutorials' } ,
] ,
} ,
{
title : 'Help & Support' ,
items : [
{
2025-04-03 16:38:48 +00:00
label : 'Forum' ,
href : 'https://forum.freesewing.eu/' ,
2024-09-28 13:46:01 +02:00
} ,
{
2025-04-03 16:38:48 +00:00
label : 'Discord' ,
href : 'https://discord.freesewing.org/' ,
2024-09-28 13:46:01 +02:00
} ,
{
label : 'All Support Options' ,
2025-04-03 16:38:48 +00:00
href : 'https://freesewing.eu/support' ,
2024-09-28 13:46:01 +02:00
} ,
] ,
} ,
{
title : 'More' ,
items : [
{
2025-04-03 16:38:48 +00:00
label : 'FreeSewing.eu' ,
to : 'https://freesewing.eu/' ,
2024-09-28 13:46:01 +02:00
} ,
{
2025-04-03 16:38:48 +00:00
label : 'FreeSewing.social' ,
to : 'https://freesewing.social/' ,
2024-09-28 13:46:01 +02:00
} ,
{
2025-04-03 16:38:48 +00:00
label : 'Code on Codeberg' ,
href : 'https://codeberg.org/freesewing/freesewing' ,
2024-09-28 13:46:01 +02:00
} ,
] ,
} ,
] ,
2025-04-03 16:38:48 +00:00
copyright : ` <a href="https://freesewing.org/">FreeSewing</a> is brought to you by <a href="https://codeberg.eu/joostdecock">Joost De Cock</a> and <a href="https://codeberg.eu/freesewing/freesewing/blob/develop/CONTRIBUTORS.md">contributors</a> with the financial support of <a href="https://freesewing.org/patrons/join">our patrons</a> ` ,
2024-09-28 13:46:01 +02:00
} ,
prism : {
theme : prismThemes . dracula ,
darkTheme : prismThemes . dracula ,
} ,
} ,
2024-09-28 13:13:48 +02:00
}
export default config