mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-29 08:57:03 +02:00
chore: minimal es6 refactor
This commit is contained in:
parent
1eef464fc0
commit
05c90a208c
3 changed files with 10 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
||||||
const toSlug = require('./toSlug.js');
|
import toSlug from './toSlug.js';
|
||||||
|
|
||||||
function anchors(md) {
|
function anchors(md) {
|
||||||
const originalRender = md.renderer.rules.heading_open;
|
const originalRender = md.renderer.rules.heading_open;
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
/* eslint-disable react/no-danger */
|
/* eslint-disable react/no-danger */
|
||||||
|
|
||||||
const React = require('react');
|
import React from 'react';
|
||||||
const Markdown = require('remarkable');
|
import Markdown from 'remarkable';
|
||||||
const hljs = require('highlight.js');
|
import hljs from 'highlight.js';
|
||||||
const prismjs = require('prismjs');
|
import prismjs from 'prismjs';
|
||||||
|
import anchors from './anchors';
|
||||||
const anchors = require('./anchors.js');
|
|
||||||
|
|
||||||
class MarkdownBlock extends React.Component {
|
class MarkdownBlock extends React.Component {
|
||||||
content() {
|
content() {
|
||||||
|
|
|
@ -15,6 +15,10 @@ module.exports = function createBaseConfig(props) {
|
||||||
.filename(isProd ? 'bundle.js' : '[name].js')
|
.filename(isProd ? 'bundle.js' : '[name].js')
|
||||||
.publicPath(isProd ? baseUrl : '/');
|
.publicPath(isProd ? baseUrl : '/');
|
||||||
|
|
||||||
|
if (!isProd) {
|
||||||
|
config.devtool('cheap-module-eval-source-map');
|
||||||
|
}
|
||||||
|
|
||||||
config.resolve
|
config.resolve
|
||||||
.set('symlinks', true)
|
.set('symlinks', true)
|
||||||
.alias.set('@theme', themePath)
|
.alias.set('@theme', themePath)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue