mirror of
https://github.com/MODSetter/SurfSense.git
synced 2025-09-09 22:04:47 +00:00
init
This commit is contained in:
parent
24f641347d
commit
63146aa9b7
86 changed files with 18766 additions and 0 deletions
66
extension/webpack/webpack.common.js
Normal file
66
extension/webpack/webpack.common.js
Normal file
|
@ -0,0 +1,66 @@
|
|||
const webpack = require("webpack");
|
||||
const path = require("path");
|
||||
const CopyPlugin = require("copy-webpack-plugin");
|
||||
const srcDir = path.join(__dirname, "..", "src");
|
||||
|
||||
const tailwindcss = require('tailwindcss')
|
||||
const autoprefixer = require('autoprefixer')
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
popup: path.join(srcDir, 'popup.tsx'),
|
||||
background: path.join(srcDir, 'background.ts'),
|
||||
content_script: path.join(srcDir, 'content_script.tsx'),
|
||||
},
|
||||
output: {
|
||||
path: path.join(__dirname, "../dist/js"),
|
||||
filename: "[name].js",
|
||||
},
|
||||
optimization: {
|
||||
splitChunks: {
|
||||
name: "vendor",
|
||||
chunks(chunk) {
|
||||
return chunk.name !== 'background';
|
||||
}
|
||||
},
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
use: "ts-loader",
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
{
|
||||
test: /\.css$/i,
|
||||
use: [
|
||||
'style-loader',
|
||||
{
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
importLoaders: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: 'postcss-loader', // postcss loader needed for tailwindcss
|
||||
options: {
|
||||
postcssOptions: {
|
||||
ident: 'postcss',
|
||||
plugins: [tailwindcss, autoprefixer],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
extensions: [".ts", ".tsx", ".js"],
|
||||
},
|
||||
plugins: [
|
||||
new CopyPlugin({
|
||||
patterns: [{ from: ".", to: "../", context: "public" }],
|
||||
options: {},
|
||||
}),
|
||||
],
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue