Skip to content

Commit 1c68c29

Browse files
authored
WIP: Extended extension.config.js (#188)
1 parent cbf2c9b commit 1c68c29

File tree

25 files changed

+205
-237
lines changed

25 files changed

+205
-237
lines changed

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
EXTENSION_ENV=
2+
EXPERIMENTAL_ERRORS_PLUGIN=
3+
EXPERIMENTAL_EXTENSION_RESOLVER_PLUGIN=

examples/config-babel/extension.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('extension-develop').FileConfig} */
1+
/** @type {import('extension').FileConfig} */
22
module.exports = {
33
config: (config) => {
44
config.module.rules.push(

examples/content-extension-config/content/ContentApp.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import ReactLogo from '../images/logo.svg'
2+
import reactLogo from '../images/react.png'
33
import tailwindBg from '../images/tailwind_bg.png'
44
import typescriptLogo from '../images/typescript.png'
55
import tailwindLogo from '../images/tailwind.png'
@@ -38,7 +38,11 @@ export default function ContentApp() {
3838
</div>
3939
<div className="mx-auto max-w-md text-center lg:py-12 lg:mx-0 lg:flex-auto lg:text-left">
4040
<div className="flex items-center justify-center space-x-4 my-4 mx-auto">
41-
<ReactLogo className="relative inline-block w-12" />
41+
<img
42+
alt="React logo"
43+
src={reactLogo}
44+
className="relative inline-block w-12"
45+
/>
4246
<div className="text-3xl text-white">+</div>
4347
<img
4448
alt="TypeScript logo"
Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,36 @@
1-
/** @type {import('extension-develop').FileConfig} */
1+
/** @type {import('extension').FileConfig} */
22
module.exports = {
3-
config: (config) => {
4-
config.module.rules.push(
5-
{
6-
test: /\.svg$/i,
7-
type: 'asset',
8-
// *.svg?url
9-
resourceQuery: /url/
10-
},
11-
{
12-
test: /\.svg$/i,
13-
issuer: /\.[jt]sx?$/,
14-
// exclude react component if *.svg?url
15-
resourceQuery: {not: [/url/]},
16-
use: ['@svgr/webpack']
17-
}
18-
)
19-
20-
return config
21-
}
3+
browsers: {
4+
chrome: {
5+
// noOpen?: boolean
6+
// userDataDir?: string
7+
// profile?: string
8+
// preferences?: Record<string, any>
9+
// browserFlags?: string[]
10+
// startingUrl?: string
11+
// chromiumBinary?: string
12+
startingUrl: 'https://extension.js.org'
13+
},
14+
firefox: {
15+
// noOpen?: boolean
16+
// userDataDir?: string
17+
// profile?: string
18+
// preferences?: Record<string, any>
19+
// browserFlags?: string[]
20+
// startingUrl?: string
21+
// geckoBinary?: string
22+
startingUrl: 'about:debugging#/runtime/this-firefox'
23+
}
24+
},
25+
development: {
26+
// TBD
27+
// browser: DevOptions['browser']
28+
// port?: number
29+
// browser: 'firefox', // can be an array
30+
// zipFilename?: string
31+
// zip?: boolean
32+
// zipSource?: boolean
33+
// polyfill?: boolean
34+
},
35+
deployment: {}
2236
}

examples/content-extension-config/images/logo.svg

Lines changed: 0 additions & 9 deletions
This file was deleted.
Loading

examples/content-extension-config/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"url": "https://cezaraugusto.com"
1616
},
1717
"dependencies": {
18-
"@svgr/webpack": "^8.1.0",
1918
"react": "^18.1.0",
2019
"react-dom": "^18.1.0",
2120
"tailwindcss": "^3.4.1"

examples/content-main-world/extension.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('extension-develop').FileConfig} */
1+
/** @type {import('extension').FileConfig} */
22
module.exports = {
33
config: (config) => {
44
config.output.publicPath =

examples/content-react-svgr/extension.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('extension-develop').FileConfig} */
1+
/** @type {import('extension').FileConfig} */
22
module.exports = {
33
config: (config) => {
44
config.module.rules.push(

examples/new-crypto/extension.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
22

3-
/** @type {import('extension-develop').FileConfig} */
3+
/** @type {import('extension').FileConfig} */
44
module.exports = {
55
config: (config) => {
66
config.plugins = [

0 commit comments

Comments
 (0)