mirror of https://gitee.com/antv-l7/antv-l7
Merge pull request #58 from antvis/fix-example-error
fix: gatsby site examples
This commit is contained in:
commit
c9555033fd
|
@ -69,3 +69,6 @@ lib/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
public
|
public
|
||||||
.cache
|
.cache
|
||||||
|
|
||||||
|
yarn.lock
|
||||||
|
package-lock.json
|
||||||
|
|
|
@ -1,18 +1,29 @@
|
||||||
// @see https://babeljs.io/docs/en/next/config-files#project-wide-configuration
|
// @see https://babeljs.io/docs/en/next/config-files#project-wide-configuration
|
||||||
module.exports = (api) => {
|
module.exports = (api) => {
|
||||||
api.cache(() => process.env.NODE_ENV);
|
api.cache(() => process.env.NODE_ENV);
|
||||||
if(api.env("site")) { //
|
if(api.env('site')) {
|
||||||
return {
|
return {
|
||||||
"presets": [
|
"presets": [
|
||||||
|
"babel-preset-gatsby"
|
||||||
|
],
|
||||||
|
"plugins": [
|
||||||
[
|
[
|
||||||
"@babel/preset-env",
|
'@babel/plugin-proposal-decorators',
|
||||||
{
|
{
|
||||||
"loose": true,
|
legacy: true,
|
||||||
"modules": false
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
// import glsl as raw text
|
||||||
|
'babel-plugin-inline-import',
|
||||||
|
{
|
||||||
|
extensions: [
|
||||||
|
// 由于使用了 TS 的 resolveJsonModule 选项,JSON 可以直接引入,不需要当作纯文本
|
||||||
|
// '.json',
|
||||||
|
'.glsl',
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
'@babel/preset-react',
|
|
||||||
"babel-preset-gatsby"
|
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { Scene } from '@l7/scene';
|
import { Scene } from '@l7/scene';
|
||||||
import { Marker } from '@l7/component'
|
import { Marker } from '@l7/component'
|
||||||
import * as G2Plot from '@antv/g2plot'
|
import G2Plot from '@antv/g2plot'
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
type: 'amap',
|
type: 'amap',
|
||||||
|
@ -137,5 +138,3 @@ const scene = new Scene({
|
||||||
// });
|
// });
|
||||||
|
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import './packages/component/src/css/l7.css';
|
require('./packages/component/src/css/l7.css');
|
||||||
// window.GeoTIFF = require('geotiff/dist/geotiff.bundle.js')
|
// window.GeoTIFF = require('geotiff/dist/geotiff.bundle.js')
|
||||||
window.scene = require('@l7/scene');
|
window.scene = require('./packages/scene/src');
|
||||||
window.layers= require('@l7/layers');
|
window.layers= require('./packages/layers/src');
|
||||||
window.component= require('@l7/component');
|
window.component= require('./packages/component/src');
|
||||||
window.G2Plot = require('@antv/g2plot');
|
window.g2plot = require('@antv/g2plot');
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
exports.onCreateWebpackConfig = ({ getConfig, stage, plugins }) => {
|
||||||
|
const config = getConfig();
|
||||||
|
config.resolve.extensions.push('.glsl');
|
||||||
|
config.resolve.alias = {
|
||||||
|
...config.resolve.alias,
|
||||||
|
'@l7/core': path.resolve(__dirname, 'packages/core/src'),
|
||||||
|
'@l7/component': path.resolve(__dirname, 'packages/component/src'),
|
||||||
|
'@l7/layers': path.resolve(__dirname, 'packages/layers/src'),
|
||||||
|
'@l7/maps': path.resolve(__dirname, 'packages/maps/src'),
|
||||||
|
'@l7/renderer': path.resolve(__dirname, 'packages/renderer/src'),
|
||||||
|
'@l7/scene': path.resolve(__dirname, 'packages/scene/src'),
|
||||||
|
'@l7/source': path.resolve(__dirname, 'packages/source/src'),
|
||||||
|
'@l7/utils': path.resolve(__dirname, 'packages/utils/src'),
|
||||||
|
};
|
||||||
|
};
|
File diff suppressed because it is too large
Load Diff
|
@ -5,7 +5,7 @@
|
||||||
"url": "https://github.com/antvis/L7"
|
"url": "https://github.com/antvis/L7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@antv/gatsby-theme-antv": "^0.9.7",
|
"@antv/gatsby-theme-antv": "^0.9.52",
|
||||||
"@babel/cli": "^7.6.4",
|
"@babel/cli": "^7.6.4",
|
||||||
"@babel/core": "^7.6.4",
|
"@babel/core": "^7.6.4",
|
||||||
"@babel/plugin-proposal-decorators": "^7.6.0",
|
"@babel/plugin-proposal-decorators": "^7.6.0",
|
||||||
|
@ -90,7 +90,7 @@
|
||||||
"worker-loader": "^2.0.0"
|
"worker-loader": "^2.0.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "export NODE_ENV=site && npm run site:develop",
|
"start": "NODE_ENV=site npm run site:develop",
|
||||||
"site:develop": "gatsby develop --open -H 0.0.0.0",
|
"site:develop": "gatsby develop --open -H 0.0.0.0",
|
||||||
"site:build": "npm run site:clean && export NODE_ENV=site && gatsby build --prefix-paths",
|
"site:build": "npm run site:clean && export NODE_ENV=site && gatsby build --prefix-paths",
|
||||||
"site:clean": "gatsby clean",
|
"site:clean": "gatsby clean",
|
||||||
|
|
Loading…
Reference in New Issue