Skip to content

Commit f561493

Browse files
committed
fix: uepr-38: fix imports
1 parent f2adf68 commit f561493

File tree

4 files changed

+11
-33
lines changed

4 files changed

+11
-33
lines changed

src/components/gui/gui.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import {connect} from 'react-redux';
77
import MediaQuery from 'react-responsive';
88
import {Tab, Tabs, TabList, TabPanel} from 'react-tabs';
99
import tabStyles from 'react-tabs/style/react-tabs.css';
10-
import VM from '@scratch/scratch-vm';
11-
import Renderer from '@scratch/scratch-render';
10+
import VM from 'scratch-vm';
11+
import Renderer from 'scratch-render';
1212

1313
import Blocks from '../../containers/blocks.jsx';
1414
import CostumeTab from '../../containers/costume-tab.jsx';

src/components/menu-bar/menu-bar.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import bindAll from 'lodash.bindall';
77
import bowser from 'bowser';
88
import React from 'react';
99

10-
import VM from '@scratch/scratch-vm';
10+
import VM from 'scratch-vm';
1111

1212
import Box from '../box/box.jsx';
1313
import Button from '../button/button.jsx';

src/containers/gui.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from 'react';
33
import {compose} from 'redux';
44
import {connect} from 'react-redux';
55
import ReactModal from 'react-modal';
6-
import VM from '@scratch/scratch-vm';
6+
import VM from 'scratch-vm';
77
import {injectIntl, intlShape} from 'react-intl';
88

99
import ErrorBoundaryHOC from '../lib/error-boundary-hoc.jsx';

webpack.config.js

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const baseConfig = new ScratchWebpackConfigBuilder(
2525
{
2626
rootPath: path.resolve(__dirname),
2727
enableReact: true,
28-
enableTs: true,
2928
shouldSplitChunks: false
3029
})
3130
.setTarget('browserslist')
@@ -35,10 +34,7 @@ const baseConfig = new ScratchWebpackConfigBuilder(
3534
library: {
3635
name: 'GUI',
3736
type: 'umd2'
38-
},
39-
// Do not clean the JS files before building as we have two outputs to the same
40-
// dist directory (the regular and the standalone version)
41-
clean: false
37+
}
4238
},
4339
resolve: {
4440
fallback: {
@@ -61,11 +57,11 @@ const baseConfig = new ScratchWebpackConfigBuilder(
6157
.addPlugin(new CopyWebpackPlugin({
6258
patterns: [
6359
{
64-
from: '../../node_modules/scratch-blocks/media',
60+
from: 'node_modules/scratch-blocks/media',
6561
to: 'static/blocks-media/default'
6662
},
6763
{
68-
from: '../../node_modules/scratch-blocks/media',
64+
from: 'node_modules/scratch-blocks/media',
6965
to: 'static/blocks-media/high-contrast'
7066
},
7167
{
@@ -76,7 +72,7 @@ const baseConfig = new ScratchWebpackConfigBuilder(
7672
force: true
7773
},
7874
{
79-
context: '../../node_modules/@scratch/scratch-vm/dist/web',
75+
context: 'node_modules/scratch-vm/dist/web',
8076
from: 'extension-worker.{js,js.map}',
8177
noErrorOnMissing: true
8278
}
@@ -91,13 +87,12 @@ if (!process.env.CI) {
9187
const distConfig = baseConfig.clone()
9288
.merge({
9389
entry: {
94-
'scratch-gui': path.join(__dirname, 'src/index.ts')
90+
'scratch-gui': path.join(__dirname, 'src/index.js')
9591
},
9692
output: {
9793
path: path.resolve(__dirname, 'dist')
9894
}
9995
})
100-
.addExternals(['react', 'react-dom', 'redux', 'react-redux'])
10196
.addPlugin(
10297
new CopyWebpackPlugin({
10398
patterns: [
@@ -110,17 +105,6 @@ const distConfig = baseConfig.clone()
110105
})
111106
);
112107

113-
// build the shipping library in `dist/` bundled with react, react-dom, redux, etc.
114-
const distStandaloneConfig = baseConfig.clone()
115-
.merge({
116-
entry: {
117-
'scratch-gui-standalone': path.join(__dirname, 'src/index-standalone.tsx')
118-
},
119-
output: {
120-
path: path.resolve(__dirname, 'dist')
121-
}
122-
});
123-
124108
// build the examples and debugging tools in `build/`
125109
const buildConfig = baseConfig.clone()
126110
.enableDevServer(process.env.PORT || 8601)
@@ -132,13 +116,7 @@ const buildConfig = baseConfig.clone()
132116
player: './src/playground/player.jsx'
133117
},
134118
output: {
135-
path: path.resolve(__dirname, 'build'),
136-
137-
// This output is loaded using a file:// scheme from the local file system.
138-
// Having `publicPath: '/'` (the default) means the `gui.js` file in `build/index.html`
139-
// would be looked for at the root of the filesystem, which is incorrect.
140-
// Hence, we're resetting the public path to be relative.
141-
publicPath: ''
119+
path: path.resolve(__dirname, 'build')
142120
}
143121
})
144122
.addPlugin(new HtmlWebpackPlugin({
@@ -189,5 +167,5 @@ const buildConfig = baseConfig.clone()
189167
const buildDist = process.env.NODE_ENV === 'production' || process.env.BUILD_MODE === 'dist';
190168

191169
module.exports = buildDist ?
192-
[buildConfig.get(), distStandaloneConfig.get(), distConfig.get()] :
170+
[buildConfig.get(), distConfig.get()] :
193171
buildConfig.get();

0 commit comments

Comments
 (0)