Skip to content
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

how to build unpkg version for blockly v9.2.1 #2

Open
mlzboy opened this issue Apr 1, 2024 · 2 comments
Open

how to build unpkg version for blockly v9.2.1 #2

mlzboy opened this issue Apr 1, 2024 · 2 comments

Comments

@mlzboy
Copy link

mlzboy commented Apr 1, 2024

I use your code build a codepen version,https://codepen.io/mlzboy/pen/qBwXQRB,It's all right,but it depends on newest version blockly,and my project was base on blockly v9.2.1,how to build lexical-variable-plugin for specific version blockly?
I had try to modify package.json

{
  "name": "@mit-app-inventor/blockly-block-lexical-variables",
  "version": "2.0.0",
  "description": "A Blockly plugin providing lexical/local variable support and flydown variable getters and setters.",
  "scripts": {
    "audit:fix": "blockly-scripts auditFix",
    "build": "blockly-scripts build",
    "build-nolint": "blockly-scripts build --skip-lint",
    "clean": "blockly-scripts clean",
    "lint": "blockly-scripts lint",
    "predeploy": "blockly-scripts predeploy",
    "prepublishOnly": "npm run clean && npm run build-nolint",
    "start": "blockly-scripts start --skip-lint",
    "test": "blockly-scripts test"
  },
  "main": "./dist/index.js",
  "module": "./src/index.js",
  "unpkg": "./dist/index.js",
  "author": "",
  "keywords": [
    "blockly",
    "blockly-plugin",
    "blockly-block",
    "lexical-variables",
    "local-variables"
  ],
  "homepage": "https://github.com/mit-cml/blockly-plugins/tree/main/block-lexical-variables#readme",
  "bugs": {
    "url": "https://github.com/mit-mcl/blockly-plugins/issues"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/mit-cml/blockly-plugins.git",
    "directory": "block-lexical-variables"
  },
  "license": "Apache-2.0",
  "directories": {
    "dist": "dist",
    "src": "src"
  },
  "files": [
    "dist",
    "src"
  ],
  "type": "module",
  "devDependencies": {
    "@blockly/dev-scripts": "^1.2.27",
    "@blockly/dev-tools": "^5.2.4",
    "chai": "^4.3.7",
    "mocha": "^10.2.0"
  },
  "publishConfig": {},
  "eslintConfig": {
    "extends": "@blockly/eslint-config"
  },
  "engines": {
    "node": ">=8.17.0"
  },
  "browserslist": [
    "defaults",
    "IE 11",
    "IE_Mob 11"
  ]
}

make "@blockly/dev-scripts": "^1.2.27",
"@blockly/dev-tools": "^5.2.4",
the version lower,then use npm run prepublishOnly to build dist/index.js,and put this file on codepen,make a demo for v9.2.1,https://codepen.io/mlzboy/pen/jORaBwd,but this not work,throw error as bellows

image

@mark-friedman
Copy link
Collaborator

@mlzboy Maybe try version 1.0.0 of the plugin (here)

@mark-friedman
Copy link
Collaborator

@mlzboy Maybe try version 1.0.0 of the plugin (here)

Sorry, I didn't read carefully enough and didn't realize that you want to use unpkg. I don't think that you can use unpkg with v1.0.0 of the plugin. Your best bet, I think, would be to update your Blockly app to use the Blockly v10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants