Skip to content

rrowe404/webpack-userscript-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Webpack Userscript Config

This is an opinionated configuration for Webpack for building userscripts. It supports building multiple userscripts from the same repository.

Requires folder structure:

- src
  - <name>
      - <name>.meta.ts
      - <name>.user.ts

Meta files should module.exports an object fitting the Metadata interface from userscript-metadata-generator

Usage: (webpack.config.ts)

import { UserscriptConfig } from 'webpack-userscript-config';
export default new UserscriptConfig(__dirname).getConfiguration();

Usage: (tsconfig.json)

{
  "extends": "./node_modules/webpack-userscript-config/tsconfig.json"
}

Usage: (src/tsconfig.json)

{
    "extends" : "../node_modules/webpack-userscript-config/tsconfig-src.json",
}

The outer configuration allows webpack to use __dirname, while the inner configuration outputs the code in a human-readable form with tree-shaken dependencies.

About

Opinionated webpack config for building userscripts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors