Skip to content

Commit

Permalink
Update compatibility with newer packages
Browse files Browse the repository at this point in the history
alphabt committed Jul 9, 2021
1 parent ea46a32 commit 494ad06
Showing 3 changed files with 255 additions and 33 deletions.
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mortality",
"version": "1.1.0",
"version": "1.2.0",
"description": "Replace new tab page with Mortality",
"license": "MIT",
"engines": {
@@ -10,8 +10,8 @@
"lint": "eslint --ext .js,.vue src",
"prettier": "prettier \"src/**/*.{js,vue}\"",
"prettier:write": "npm run prettier -- --write",
"build": "cross-env NODE_ENV=production webpack --hide-modules",
"build:dev": "cross-env NODE_ENV=development webpack --hide-modules",
"build": "cross-env NODE_ENV=production webpack",
"build:dev": "cross-env NODE_ENV=development webpack",
"build-zip": "node scripts/build-zip.js",
"watch": "npm run build -- --watch",
"watch:dev": "cross-env HMR=true npm run build:dev -- --watch"
@@ -33,6 +33,7 @@
"@babel/preset-env": "^7.14.7",
"@babel/runtime-corejs3": "^7.14.7",
"@types/chrome": "^0.0.146",
"@vue/compiler-sfc": "^3.1.4",
"archiver": "^5.3.0",
"babel-eslint": "^10.0.3",
"babel-loader": "^8.2.2",
@@ -59,7 +60,7 @@
"prettier": "^2.3.2",
"pretty-quick": "^3.1.1",
"sass-loader": "^12.1.0",
"vue-loader": "^16.3.0",
"vue-loader": "^15.4.2",
"vue-template-compiler": "^2.6.14",
"webpack": "^5.44.0",
"webpack-cli": "^4.7.2",
40 changes: 24 additions & 16 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ const config = {
rules: [
{
test: /\.vue$/,
loaders: 'vue-loader',
loader: 'vue-loader',
},
{
test: /\.js$/,
@@ -72,24 +72,32 @@ const config = {
new MiniCssExtractPlugin({
filename: '[name].css',
}),
new CopyPlugin([
{ from: 'icons', to: 'icons', ignore: ['icon.xcf'] },
{ from: 'tab/tab.html', to: 'tab/tab.html', transform: transformHtml },
{
from: 'manifest.json',
to: 'manifest.json',
transform: content => {
const jsonContent = JSON.parse(content);
jsonContent.version = version;
new CopyPlugin({
patterns: [
{
from: 'icons',
to: 'icons',
globOptions: {
ignore: ['icon.xcf'],
},
},
{ from: 'tab/tab.html', to: 'tab/tab.html', transform: transformHtml },
{
from: 'manifest.json',
to: 'manifest.json',
transform: (content) => {
const jsonContent = JSON.parse(content);
jsonContent.version = version;

if (config.mode === 'development') {
jsonContent.content_security_policy = "script-src 'self' 'unsafe-eval'; object-src 'self'";
}
if (config.mode === 'development') {
jsonContent.content_security_policy = "script-src 'self' 'unsafe-eval'; object-src 'self'";
}

return JSON.stringify(jsonContent, null, 2);
return JSON.stringify(jsonContent, null, 2);
},
},
},
]),
],
}),
],
};

Loading

0 comments on commit 494ad06

Please sign in to comment.