feat(cfp): Updated for React 17 / CRA 4 / Webpack 5
This commit is contained in:
parent
e3358a03ef
commit
380fa33c6a
7 changed files with 34 additions and 19 deletions
|
@ -2,8 +2,17 @@ import React from 'react'
|
|||
import freesewing from '@freesewing/core'
|
||||
import Workbench from '@freesewing/components/Workbench'
|
||||
import '@freesewing/css-theme'
|
||||
import Pattern from './pattern/src/index.js'
|
||||
/*
|
||||
* The following symlink is required to make this import work:
|
||||
* `root_folder/example/src/pattern => `../../`
|
||||
*
|
||||
* Without it, we can't import the pattern as a local file
|
||||
* since create-react-app does not allow imports outside ./src
|
||||
* If it's imported as a dependency, webpack will cache the
|
||||
* build and there will be no hot-relaoding of changes
|
||||
*/
|
||||
|
||||
import Pattern from 'pattern'
|
||||
|
||||
const App = (props) => {
|
||||
// You can use this to add transations
|
||||
|
|
|
@ -5,7 +5,7 @@ import commonjs from '@rollup/plugin-commonjs'
|
|||
import json from '@rollup/plugin-json'
|
||||
import { terser } from 'rollup-plugin-terser'
|
||||
import peerDepsExternal from 'rollup-plugin-peer-deps-external'
|
||||
import postcss from 'rollup-plugin-postcss'
|
||||
//import postcss from 'rollup-plugin-postcss'
|
||||
import { name, version, description, author, license } from './package.json'
|
||||
|
||||
import pkg from './package.json'
|
||||
|
@ -28,9 +28,9 @@ export default {
|
|||
],
|
||||
plugins: [
|
||||
peerDepsExternal(),
|
||||
postcss({
|
||||
modules: true
|
||||
}),
|
||||
//postcss({
|
||||
// modules: true
|
||||
//}),
|
||||
url({ exclude: ['**/*.svg'] }),
|
||||
babel({
|
||||
exclude: 'node_modules/**'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue