-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a1a23f
commit e69aa79
Showing
7 changed files
with
64 additions
and
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,27 @@ | ||
const withCSS = require('@zeit/next-css') | ||
const withLess = require('@zeit/next-less') | ||
|
||
module.exports = withCSS( | ||
withLess({ | ||
webpack(config) { | ||
config.module.rules.forEach(rule => { | ||
if (Array.isArray(rule.use)) { | ||
rule.use.forEach(u => { | ||
if (u.loader === 'css-loader' && u.options) { | ||
delete u.options.minimize | ||
} | ||
}) | ||
} | ||
}) | ||
module.exports = withLess({ | ||
lessLoaderOptions: { | ||
javascriptEnabled: true | ||
}, | ||
webpack(config) { | ||
config.module.rules.push({ | ||
test: /\.css$/, | ||
use: ['style-loader', 'css-loader'] | ||
}) | ||
|
||
return Object.assign(config, { | ||
target: 'electron-renderer', | ||
devtool: 'cheap-module-source-map', | ||
plugins: config.plugins.filter(p => { | ||
return p.constructor.name !== 'UglifyJsPlugin' | ||
}) | ||
return Object.assign(config, { | ||
target: 'electron-renderer', | ||
devtool: 'cheap-module-source-map', | ||
plugins: config.plugins.filter(p => { | ||
return p.constructor.name !== 'UglifyJsPlugin' | ||
}) | ||
}, | ||
exportPathMap() { | ||
return { | ||
'/main': { page: '/main' } | ||
} | ||
}) | ||
}, | ||
exportPathMap() { | ||
return { | ||
'/main': { page: '/main' } | ||
} | ||
}) | ||
) | ||
} | ||
}) |
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,19 +1,19 @@ | ||
import App from 'next/app' | ||
import 'antd/dist/antd.css' | ||
import 'antd/dist/antd.less' | ||
|
||
export default class IMApp extends App { | ||
componentDidCatch(error: any, errorInfo: any) { | ||
// This is needed to render errors correctly in development / production | ||
// todo | ||
// super.componentDidCatch(error, errorInfo) | ||
} | ||
componentDidCatch(error: any, errorInfo: any) { | ||
// This is needed to render errors correctly in development / production | ||
// todo | ||
// super.componentDidCatch(error, errorInfo) | ||
} | ||
|
||
componentDidMount() { | ||
console.log('app componentDidMount') | ||
} | ||
componentDidMount() { | ||
console.log('app componentDidMount') | ||
} | ||
|
||
render() { | ||
const { Component, pageProps } = this.props | ||
return <Component {...pageProps} /> | ||
} | ||
render() { | ||
const { Component, pageProps } = this.props | ||
return <Component {...pageProps} /> | ||
} | ||
} |
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,16 @@ | ||
import React, { Component } from 'react' | ||
import MonacoEditor from 'react-monaco-editor' | ||
|
||
export default props => ( | ||
<MonacoEditor | ||
width={500} | ||
height={200} | ||
language='javascript' | ||
theme='vs-dark' | ||
value='' | ||
options={{ selectOnLineNumbers: true }} | ||
onChange={() => null} | ||
editorDidMount={() => null} | ||
{...props} | ||
/> | ||
) |
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
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