-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'protocol_designer-migrate-webpack-to-vite' of github.co…
…m:Opentrons/opentrons into protocol_designer-migrate-webpack-to-vite
- Loading branch information
Showing
38 changed files
with
2,571 additions
and
2,938 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
'use strict' | ||
|
||
const { baseConfig } = require('@opentrons/webpack-config') | ||
|
||
module.exports = { | ||
webpackFinal: config => ({ | ||
...config, | ||
module: { ...config.module, rules: baseConfig.module.rules }, | ||
plugins: [...config.plugins, ...baseConfig.plugins], | ||
}), | ||
stories: [ | ||
'../components/**/*.stories.@(js|jsx|ts|tsx)', | ||
'../app/**/*.stories.@(js|jsx|ts|tsx)', | ||
], | ||
|
||
addons: [ | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'storybook-addon-pseudo-states', | ||
], | ||
|
||
framework: { | ||
name: '@storybook/react-vite', | ||
options: {} | ||
}, | ||
|
||
docs: { | ||
autodocs: true | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import { versionForProject } from '../scripts/git-version' | ||
import pkg from './package.json' | ||
import path from 'path' | ||
import { UserConfig, defineConfig } from 'vite' | ||
import react from '@vitejs/plugin-react' | ||
import postCssImport from 'postcss-import' | ||
import postCssApply from 'postcss-apply' | ||
import postColorModFunction from 'postcss-color-mod-function' | ||
import postCssPresetEnv from 'postcss-preset-env' | ||
import lostCss from 'lost' | ||
|
||
export default defineConfig( | ||
async (): Promise<UserConfig> => { | ||
const project = process.env.OPENTRONS_PROJECT ?? 'robot-stack' | ||
const version = await versionForProject(project) | ||
return { | ||
publicDir: false, | ||
build: { | ||
// Relative to the root | ||
ssr: 'src/main.ts', | ||
outDir: 'lib', | ||
commonjsOptions: { | ||
transformMixedEsModules: true, | ||
esmExternals: true, | ||
}, | ||
lib: { | ||
entry: { | ||
main: 'src/main.ts', | ||
preload: 'src/preload.ts', | ||
}, | ||
|
||
formats: ['cjs'], | ||
}, | ||
}, | ||
plugins: [ | ||
react({ | ||
include: '**/*.tsx', | ||
babel: { | ||
// Use babel.config.js files | ||
configFile: true, | ||
}, | ||
}), | ||
], | ||
optimizeDeps: { | ||
esbuildOptions: { | ||
target: 'CommonJs', | ||
}, | ||
}, | ||
css: { | ||
postcss: { | ||
plugins: [ | ||
postCssImport({ root: 'src/' }), | ||
postCssApply(), | ||
postColorModFunction(), | ||
postCssPresetEnv({ stage: 0 }), | ||
lostCss(), | ||
], | ||
}, | ||
}, | ||
define: { | ||
'process.env': process.env, | ||
global: 'globalThis', | ||
_PKG_VERSION_: JSON.stringify(version), | ||
_PKG_PRODUCT_NAME_: JSON.stringify(pkg.productName), | ||
_PKG_BUGS_URL_: JSON.stringify(pkg.bugs.url), | ||
_OPENTRONS_PROJECT_: JSON.stringify(project), | ||
}, | ||
resolve: { | ||
alias: { | ||
'@opentrons/components/styles': path.resolve( | ||
'../components/src/index.module.css' | ||
), | ||
'@opentrons/components': path.resolve('../components/src/index.ts'), | ||
'@opentrons/shared-data': path.resolve('../shared-data/js/index.ts'), | ||
'@opentrons/step-generation': path.resolve( | ||
'../step-generation/src/index.ts' | ||
), | ||
'@opentrons/discovery-client': path.resolve( | ||
'../discovery-client/src/index.ts' | ||
), | ||
'@opentrons/usb-bridge/node-client': path.resolve( | ||
'../usb-bridge/node-client/src/index.ts' | ||
), | ||
}, | ||
}, | ||
} | ||
} | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.