Skip to content

Bump ejs, @vue/cli-plugin-babel and @vue/cli-service #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
const devPresets = ['@vue/babel-preset-app'];
const buildPresets = ['@babel/preset-env'];
const devPresets = ["@vue/babel-preset-app"];
const buildPresets = [
[
"@babel/preset-env",
// Config for @babel/preset-env
{
// Example: Always transpile optional chaining/nullish coalescing
// include: [
// /(optional-chaining|nullish-coalescing)/
// ],
},
],
];
module.exports = {
presets: (process.env.NODE_ENV === 'development' ? devPresets : buildPresets),
presets: process.env.NODE_ENV === "development" ? devPresets : buildPresets,
};
73 changes: 31 additions & 42 deletions build/rollup.config.js
Original file line number Diff line number Diff line change
@@ -4,11 +4,10 @@ import path from "path";
import vue from "rollup-plugin-vue";
import alias from "@rollup/plugin-alias";
import commonjs from "@rollup/plugin-commonjs";
import resolve from "@rollup/plugin-node-resolve";
import replace from "@rollup/plugin-replace";
import babel from "rollup-plugin-babel";
import postcss from "rollup-plugin-postcss";
import babel from "@rollup/plugin-babel";
import { terser } from "rollup-plugin-terser";
import postcssLogical from "postcss-logical";
import minimist from "minimist";

// Get browserslist config and remove ie from es build targets
@@ -18,6 +17,11 @@ const esbrowserslist = fs
.split("\n")
.filter((entry) => entry && entry.substring(0, 2) !== "ie");

// Extract babel preset-env config, to combine with esbrowserslist
const babelPresetEnvConfig = require("../babel.config").presets.filter(
(entry) => entry[0] === "@babel/preset-env"
)[0][1];

const argv = minimist(process.argv.slice(2));

const projectRoot = path.resolve(__dirname, "..");
@@ -27,25 +31,35 @@ const baseConfig = {
plugins: {
preVue: [
alias({
resolve: [".js", ".jsx", ".ts", ".tsx", ".vue"],
entries: {
"@": path.resolve(projectRoot, "src"),
},
entries: [
{
find: "@",
replacement: `${path.resolve(projectRoot, "src")}`,
},
],
}),
],
replace: {
preventAssignment: true,
"process.env.NODE_ENV": JSON.stringify("production"),
"process.env.ES_BUILD": JSON.stringify("false"),
"process.env.ES_BUILD": JSON.stringify("true"),
},
vue: {
css: true,
template: {
isProduction: true,
},
},
postVue: [
resolve({
extensions: [".js", ".jsx", ".ts", ".tsx", ".vue"],
}),
commonjs(),
],
babel: {
exclude: "node_modules/**",
extensions: [".js", ".jsx", ".ts", ".tsx", ".vue"],
babelHelpers: "bundled",
},
},
};
@@ -74,28 +88,26 @@ if (!argv.format || argv.format === "es") {
external,
output: {
file: "dist/esm.js",
format: "es",
format: "esm",
exports: "named",
},
plugins: [
replace({
...baseConfig.plugins.replace,
"process.env.ES_BUILD": JSON.stringify("true"),
}),
replace(baseConfig.plugins.replace),
...baseConfig.plugins.preVue,
vue(baseConfig.plugins.vue),
...baseConfig.plugins.postVue,
babel({
...baseConfig.plugins.babel,
presets: [
[
"@babel/preset-env",
{
...babelPresetEnvConfig,
targets: esbrowserslist,
},
],
],
}),
commonjs(),
],
};
buildFormats.push(esConfig);
@@ -110,7 +122,7 @@ if (!argv.format || argv.format === "cjs") {
file: "dist/ssr.js",
format: "cjs",
name: "VueNotion",
exports: "named",
exports: "auto",
globals,
},
plugins: [
@@ -123,8 +135,8 @@ if (!argv.format || argv.format === "cjs") {
optimizeSSR: true,
},
}),
...baseConfig.plugins.postVue,
babel(baseConfig.plugins.babel),
commonjs(),
],
};
buildFormats.push(umdConfig);
@@ -138,16 +150,16 @@ if (!argv.format || argv.format === "iife") {
compact: true,
file: "dist/min.js",
format: "iife",
name: "VueNotion",
name: "VuteNotion",
exports: "named",
globals,
},
plugins: [
replace(baseConfig.plugins.replace),
...baseConfig.plugins.preVue,
vue(baseConfig.plugins.vue),
...baseConfig.plugins.postVue,
babel(baseConfig.plugins.babel),
commonjs(),
terser({
output: {
ecma: 5,
@@ -158,28 +170,5 @@ if (!argv.format || argv.format === "iife") {
buildFormats.push(unpkgConfig);
}

if (!argv.format || argv.format === "postcss") {
const postCssConfig = {
input: "build/postcss.js",
output: {
format: "es",
file: "dist/styles.ignore",
},
plugins: [
postcss({
extract: true,
minimize: true,
plugins: [postcssLogical()],
}),
],
};
buildFormats.push(postCssConfig);
}

// Export config
export default (commandLineArgs) => {
// Exporting a method enables command line args override
// https://rollupjs.org/guide/en/#configuration-files
delete commandLineArgs.format;
return buildFormats;
};
export default buildFormats;
16,275 changes: 8,599 additions & 7,676 deletions example/package-lock.json

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -9,13 +9,16 @@
"generate": "nuxt generate"
},
"dependencies": {
"core-js": "^3.21.1",
"katex": "^0.15.2",
"nuxt": "^2.15.8",
"prismjs": "^1.27.0",
"core-js": "^3.28.0",
"katex": "^0.12.0",
"nuxt": "^2.16.1",
"prismjs": "^1.29.0",
"vue-katex": "^0.5.0"
},
"devDependencies": {
"vue-notion": "^1.4.3"
"vue-notion": "^1.5.0"
},
"engines": {
"node": ">12 <18"
}
}
33,020 changes: 6,288 additions & 26,732 deletions package-lock.json

Large diffs are not rendered by default.

72 changes: 35 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,68 +1,66 @@
{
"name": "vue-notion",
"version": "1.4.3",
"version": "1.5.0",
"description": "A Vue renderer for Notion pages",
"repository": "github:janniks/vue-notion",
"main": "dist/esm.js",
"browser": "dist/esm.js",
"module": "dist/esm.js",
"browser": "dist/esm.js",
"unpkg": "dist/min.js",
"files": [
"dist/**/*.js",
"dist/**/*.css",
"src/**/*.css",
"nuxt/*.js"
"dist/**/*.js",
"nuxt/*.js",
"src/**/*.css"
],
"scripts": {
"serve": "vue-cli-service serve dev/serve.js",
"example": "npm run example:generate && cd example && npm start",
"example:install": "npm pack && cd example && npm install && npm install ../*.tgz",
"example:generate": "npm run example:install && cd example && npm run build && npm run generate",
"build": "cross-env NODE_ENV=production rollup --config build/rollup.config.js",
"build:ssr": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format cjs",
"build:es": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format es",
"build:ssr": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format cjs",
"build:unpkg": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format iife",
"clean": "rm -rf node_modules dist example/node_modules example/dist example/.nuxt",
"example": "npm run example:generate && cd example && npm start",
"example:generate": "npm run example:install && cd example && npm run build && npm run generate",
"example:install": "npm pack && cd example && npm install && npm install ../*.tgz",
"prepare": "rm -rf dist *.tgz && npm run build",
"postpublish": "echo \"\\033[31m !!! Now, manually run: ./scripts/postpublish.sh !!! \\033[00m\"",
"release:minor": "npm version minor -m 'Release %s' && npm publish",
"release:patch": "npm version patch -m 'Release %s' && npm publish",
"postpublish": "echo \"\\033[31m !!! Now, manually run: ./scripts/postpublish.sh !!! \\033[00m\"",
"prepare": "rm -rf dist *.tgz && npm run build"
"serve": "vue-cli-service serve dev/serve.js"
},
"dependencies": {
"cross-fetch": "^3.0.6",
"defu": "^5.0.0",
"vue-fragment": "^1.5.1",
"cross-fetch": "^3.1.5",
"defu": "^6.1.2",
"vue-fragment": "^1.6.0",
"vue-prism-component": "^1.2.0"
},
"devDependencies": {
"@babel/core": "^7.9.0",
"@babel/preset-env": "^7.9.5",
"@rollup/plugin-alias": "^2.2.0",
"@rollup/plugin-commonjs": "^20.0.0",
"@rollup/plugin-replace": "^3.0.0",
"@types/prismjs": "^1.16.6",
"@vue/cli-plugin-babel": "^4.3.1",
"@vue/cli-service": "^4.3.1",
"cross-env": "^7.0.2",
"cross-fetch": "^3.0.6",
"@babel/core": "^7.14.6",
"@babel/preset-env": "^7.14.7",
"@rollup/plugin-alias": "^3.1.2",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^14.0.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.4.2",
"@types/prismjs": "^1.26.0",
"@vue/cli-plugin-babel": "^5.0.8",
"@vue/cli-service": "^5.0.8",
"cross-env": "^7.0.3",
"cross-fetch": "^3.1.5",
"minimist": "^1.2.5",
"postcss": "^8.2.1",
"postcss-logical": "^4.0.2",
"prismjs": "^1.22.0",
"rollup": "^2.7.3",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-postcss": "^4.0.0",
"postcss": "^8.4.21",
"postcss-logical": "^6.1.0",
"prismjs": "^1.29.0",
"rimraf": "^3.0.2",
"rollup": "^2.52.8",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-vue": "^5.1.9",
"vue": "^2.6.14",
"vue": "^2.7.14",
"vue-katex": "^0.5.0",
"vue-template-compiler": "^2.6.14"
"vue-template-compiler": "^2.7.14"
},
"peerDependencies": {
"prismjs": "^1.22.0",
"vue": "^2.6.14"
},
"engines": {
"node": ">=10"
"vue": "^2.7.14"
}
}
2 changes: 1 addition & 1 deletion src/entry.js
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ const install = function installVueNotion(Vue) {

// Create module definition for Vue.use()
const plugin = {
install
install,
};

// To auto-install on non-es builds, when vue is found