fix: gatsby site examples

This commit is contained in:
afc163 2019-11-14 18:15:58 +08:00
parent 7c58ebe505
commit eccedee6ea
4 changed files with 13 additions and 16189 deletions

View File

@ -1,21 +1,6 @@
// @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")) { //
return {
"presets": [
[
"@babel/preset-env",
{
"loose": true,
"modules": false
}
],
'@babel/preset-react',
"babel-preset-gatsby"
]
};
}
return { return {
presets: [ presets: [
[ [
@ -27,13 +12,9 @@ module.exports = (api) => {
}, },
}, },
], ],
[ '@babel/preset-react',
'@babel/preset-react',
{
development: process.env.BABEL_ENV !== 'build',
},
],
'@babel/preset-typescript', '@babel/preset-typescript',
'babel-preset-gatsby',
], ],
plugins: [ plugins: [
'@babel/plugin-proposal-optional-chaining', '@babel/plugin-proposal-optional-chaining',

View File

@ -1,6 +1,6 @@
import './packages/component/src/css/l7.css'; import './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');

7
gatsby-node.js Normal file
View File

@ -0,0 +1,7 @@
const setWebpackConfig = require('./.storybook/webpack.config');
exports.onCreateWebpackConfig = ({ getConfig, stage, plugins }) => {
const config = getConfig();
config.resolve.extensions.push('.glsl');
console.log(config);
};

16164
yarn.lock

File diff suppressed because it is too large Load Diff