mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Build separate vertical and horizontal modules
This allows separate imports for vertical and horizontal libraries, and gives a way to import the library outside of webpack.
This commit is contained in:
parent
ff57c4e4d6
commit
1ff45f5c77
7 changed files with 25 additions and 5 deletions
|
@ -9,3 +9,5 @@
|
|||
/accessible/*
|
||||
/appengine/*
|
||||
/shim/*
|
||||
/dist/*
|
||||
/webpack.config.js
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -20,3 +20,4 @@ php_compressed.js
|
|||
python_compressed.js
|
||||
|
||||
/accessible/*
|
||||
/dist
|
||||
|
|
|
@ -9,13 +9,15 @@
|
|||
"type": "git",
|
||||
"url": "https://github.com/LLK/scratch-blocks.git"
|
||||
},
|
||||
"webpack": "./shim/index.js",
|
||||
"main": "./dist/vertical.js",
|
||||
"scripts": {
|
||||
"test": "./node_modules/.bin/eslint ."
|
||||
"prepublish": "webpack",
|
||||
"test": "eslint ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "2.9.0",
|
||||
"exports-loader": "0.6.3",
|
||||
"imports-loader": "0.6.5"
|
||||
"imports-loader": "0.6.5",
|
||||
"webpack": "1.13.2"
|
||||
}
|
||||
}
|
||||
|
|
1
shim/horizontal.js
Normal file
1
shim/horizontal.js
Normal file
|
@ -0,0 +1 @@
|
|||
module.exports = require('imports?Blockly=../shim/blocks_compressed_horizontal,goog=../shim/blockly_compressed_horizontal.goog!exports?Blockly!../msg/messages');
|
|
@ -12,6 +12,6 @@
|
|||
* msg/messages
|
||||
**/
|
||||
module.exports = {
|
||||
Horizontal: require('imports?Blockly=../shim/blocks_compressed_horizontal,goog=../shim/blockly_compressed_horizontal.goog!exports?Blockly!../msg/messages'),
|
||||
Vertical: require('imports?Blockly=../shim/blocks_compressed_vertical,goog=../shim/blockly_compressed_vertical.goog!exports?Blockly!../msg/messages')
|
||||
Horizontal: require('./horizontal'),
|
||||
Vertical: require('./vertical')
|
||||
};
|
||||
|
|
1
shim/vertical.js
Normal file
1
shim/vertical.js
Normal file
|
@ -0,0 +1 @@
|
|||
module.exports = require('imports?Blockly=../shim/blocks_compressed_vertical,goog=../shim/blockly_compressed_vertical.goog!exports?Blockly!../msg/messages');
|
13
webpack.config.js
Normal file
13
webpack.config.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
var path = require('path');
|
||||
module.exports = {
|
||||
entry: {
|
||||
horizontal: './shim/horizontal.js',
|
||||
vertical: './shim/vertical.js'
|
||||
},
|
||||
output: {
|
||||
library: 'ScratchBlocks',
|
||||
libraryTarget: 'commonjs2',
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
filename: '[name].js'
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue