Skip to content

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

@mlzboy

Description

@mlzboy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions