AnandChowdhary / calendar-link

📅 Calendar link generator for popular services
https://anandchowdhary.github.io/calendar-link/
MIT License
543 stars 71 forks source link

ERROR in ./node_modules/calendar-link/dist/index.js Module parse failed: Unexpected token (17:34) #246

Closed integerManual closed 3 years ago

integerManual commented 3 years ago

Hy.. im new on this nodejs (thingy), so i dont know what i do.

i'm trying to integrate calendar link to Grapesjs (i mean grapesjs preset https://github.com/artf/grapesjs-preset-webpage).

run on terminal npm install calendar-link then on my index.js add import { google, outlook, office365, yahoo, ics } from "calendar-link"; then run npm run build get errror

ss

i dont event add another code, just import calendar-link module.

i dont know what should i do

issue-label-bot[bot] commented 3 years ago

Issue-Label Bot is automatically applying the label question to this issue, with a confidence of 0.63. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

integerManual commented 3 years ago

package.json

{
  "name": "grapesjs-preset-webpage",
  "version": "0.1.22",
  "description": "GrapesJS Plugin Webpage Preset",
  "main": "dist/grapesjs-preset-webpage.min.js",
  "scripts": {
    "lint": "eslint src",
    "v:patch": "npm version --no-git-tag-version patch",
    "build": "npm run v:patch && webpack --env.production && npm run build:css",
    "start": "webpack-dev-server --open --progress --colors & npm run build:css -- -w",
    "build:css": "node-sass src/style/main.scss dist/grapesjs-preset-webpage.min.css --output-style compressed"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/artf/grapesjs-preset-webpage.git"
  },
  "keywords": [
    "grapesjs",
    "plugin",
    "webpage",
    "preset",
    "wysiwyg"
  ],
  "author": "Artur Arseniev",
  "license": "BSD-3-Clause",
  "babel": {
    "presets": [
      "env"
    ],
    "plugins": [
      "transform-object-rest-spread"
    ]
  },
  "peerDependencies": {
    "grapesjs": "0.x"
  },
  "devDependencies": {
    "babel-core": "^6.26.0",
    "babel-loader": "^7.1.4",
    "babel-plugin-transform-object-rest-spread": "^6.26.0",
    "babel-preset-env": "^1.6.1",
    "eslint": "^4.19.1",
    "html-webpack-plugin": "^2.30.1",
    "node-sass": "^4.14.1",
    "webpack": "^3.11.0",
    "webpack-dev-server": "^2.11.2"
  },
  "dependencies": {
    "calendar-link": "^2.0.0",
    "grapesjs-aviary": "^0.1.2",
    "grapesjs-blocks-basic": "^0.1.7",
    "grapesjs-component-countdown": "^0.1.2",
    "grapesjs-navbar": "^0.1.5",
    "grapesjs-plugin-export": "^0.1.5",
    "grapesjs-plugin-filestack": "^0.1.1",
    "grapesjs-plugin-forms": "^0.3.5"
  }
}

and here's my webpack.config.js

const HtmlWebpackPlugin = require('html-webpack-plugin');
const pkg = require('./package.json');
const webpack = require('webpack');
const fs = require('fs');
const name = pkg.name;
let plugins = [];

module.exports = (env = {}) => {
  if (env.production) {
    plugins = [
      new webpack.optimize.UglifyJsPlugin({ minimize: true, compressor: { warnings: false }}),
      new webpack.BannerPlugin(`${name} - ${pkg.version}`),
    ]
  } else {
    const index = 'index.html';
    const indexDev = '_' + index;
    plugins.push(new HtmlWebpackPlugin({
      template: fs.existsSync(indexDev) ? indexDev : index
    }));
  }

  return {
    entry: './src',
    output: {
        filename: `./dist/${name}.min.js`,
        library: name,
        libraryTarget: 'umd',
    },
    module: {
      loaders: [{
          test: /\.js$/,
          loader: 'babel-loader',
          include: /src/,
      }],
    },
    externals: {'grapesjs': 'grapesjs'},
    plugins: plugins,
  };
}
FindingAnand commented 3 years ago

⚠️ This issue has not seen any activity in the past 2 months so I'm marking it as stale. I'll close it if it doesn't see any activity in the coming week.

danielmejiadev commented 3 years ago

Same issue here +1

danielmejiadev commented 3 years ago

This is my .babelrc

{
  "presets": [
    ["@babel/preset-env", {
      "exclude": ["transform-regenerator",],
      "targets": {
        "browsers": ["> 2%", "IE >= 11", "Safari >= 9.1"],
        "node": "current"
      },
      "modules": "commonjs"
    }],
    "@babel/preset-react"
  ],
  "plugins": [
    "add-module-exports",
    ["@babel/plugin-transform-runtime", {
      "helpers": true,
      "regenerator": true
    }],
    ["@babel/plugin-proposal-class-properties", {
      "loose": true
    }]
  ]
}

Using node 12.16.1

FindingAnand commented 3 years ago

⚠️ This issue has not seen any activity in the past 2 months so I'm marking it as stale. I'll close it if it doesn't see any activity in the coming week.