GithubHelp home page GithubHelp logo

Comments (3)

HakChealKim avatar HakChealKim commented on June 18, 2024

.babelrc
{ "plugins": [ "transform-decorators-legacy", "transform-class-properties", "transform-object-rest-spread", "transform-object-assign", [ "transform-runtime", { "helpers": false, "polyfill": false, "regenerator": true, "moduleName": "babel-runtime" } ] ], "presets": [ "react", "stage-0", "es2015" ] }

package.json
{ "name": "site", "version": "0.0.1", "private": true, "scripts": { "start": "docsite start", "build": "docsite build" }, "devDependencies": { "docsite": "^1.1.0", "babel-core": "6.23.1", "babel-eslint": "^6.0.5", "babel-loader": "6.4.0", "babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-object-assign": "^6.22.0", "babel-plugin-transform-object-rest-spread": "^6.23.0", "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-es2015": "6.22.0", "babel-preset-react": "6.23.0", "babel-preset-stage-0": "6.22.0", "babel-register": "^6.26.0", "css-loader": "0.6.12", "eslint": "^3.6.0", "eslint-config-ali": "^1.0.0", "eslint-plugin-import": "*", "eslint-plugin-react": "*", "extract-text-webpack-plugin": "^2.1.2", "gulp": "3.9.1", "gulp-util": "2.2.20", "json-loader": "*", "node-libs-browser": "2.0.0", "node-sass": "^4.7.2", "opn": "^5.3.0", "raw-loader": "^0.5.1", "react": "16.5.2", "react-dom": "16.5.2", "sass-loader": "6.0.2", "style-loader": "0.6.5", "webpack": "^2.6.1", "webpack-dev-server": "^2.4.5" }, "dependencies": { "classnames": "^2.2.5", "core-decorators": "^0.20.0", "js-cookie": "^2.2.0", "react": "^16.5.2", "react-dom": "^16.5.2", "react-scroll": "^1.7.9", "react-tilt": "^0.1.4", "whatwg-fetch": "^2.0.4" } }
webpack.config.js
`const path = require('path');
const fs = require('fs');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');

const entry = {};
const targetPath = path.join(__dirname, './src/pages');
fs.readdirSync(targetPath).forEach(page => {
if (
fs.statSync(path.join(targetPath, page)).isDirectory() &&
fs.existsSync(path.join(targetPath, page, 'index.jsx'))
) {
entry[page] = path.join(targetPath, page, 'index.jsx');
}
});
module.exports = {
entry,
output: {
path: path.join(__dirname, 'build'),
filename: '[name].js',
},
externals: {
react: 'React',
'react-dom': 'ReactDOM',
},
module: {
loaders: [
{
test: /.js|jsx$/,
exclude: [/node_modules/, /build/lib/, /.min.js$/],
use: 'babel-loader',
},
{
test: /.(s)?css$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'sass-loader'],
}),
},
{
test: /.json?$/,
exclude: /node_modules/,
use: 'json-loader',
},
],
},
resolve: {
extensions: ['.js', '.jsx', '.json'],
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new webpack.optimize.OccurrenceOrderPlugin(),
new ExtractTextPlugin('[name].css'),
],
};
`

from docsite.

HakChealKim avatar HakChealKim commented on June 18, 2024

降到node10
好了

from docsite.

ryshi avatar ryshi commented on June 18, 2024

遇到同样问题,只能降级node么?搜到一个类似问题 说是node 12 和 gulp 4冲突,是否可以考虑升级?

from docsite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.