Created
August 7, 2017 15:58
-
-
Save z81/e73d17b24b36fd6f00b9f2057de98bad to your computer and use it in GitHub Desktop.
My neutrinojs confi, neutrino 6.1.5, scss, es6 decorators, class-properties, react
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
const path = require('path'); | |
const HtmlPlugin = require('html-webpack-plugin'); | |
const loaderMerge = require('neutrino-middleware-loader-merge'); | |
const SRC = path.join(process.cwd(), 'src'); | |
module.exports = { | |
use: [ | |
"neutrino-preset-react", | |
({ config, use }) => { | |
config | |
.plugin('html') | |
.use(HtmlPlugin, [ | |
{ | |
template: __dirname + '/src/template.ejs', | |
inject: false, | |
appMountId: 'root', | |
xhtml: true, | |
mobile: true, | |
title: 'Fractal', | |
minify: { | |
useShortDoctype: true, | |
keepClosingSlash: true, | |
collapseWhitespace: true, | |
preserveLineBreaks: true | |
}, | |
excludeChunks: ['editor'], | |
filename: 'index.html' | |
} | |
]); | |
config | |
.plugin('html1') | |
.use(HtmlPlugin,[ { | |
template: __dirname + '/src/template.ejs', | |
inject: false, | |
appMountId: 'root', | |
xhtml: true, | |
mobile: true, | |
title: 'Editor', | |
minify: { | |
useShortDoctype: true, | |
keepClosingSlash: true, | |
collapseWhitespace: true, | |
preserveLineBreaks: true | |
}, | |
excludeChunks: ['index'], | |
template: __dirname + '/src/template.ejs', | |
filename: 'editor.html' | |
} | |
]); | |
config.module | |
.rule('style') | |
.test(/\.s?css$/) | |
.use('style') | |
.loader(require.resolve('style-loader')) | |
.end() | |
.use('css') | |
.loader(require.resolve('css-loader')) | |
.end() | |
.use('sass') | |
.loader(require.resolve('sass-loader')) | |
.end(); | |
use(loaderMerge('compile', 'babel'), { | |
plugins: [ | |
require.resolve('babel-plugin-transform-decorators-legacy'), | |
require.resolve('babel-plugin-transform-class-properties') | |
], | |
}); | |
config.resolve.extensions.add('.scss'); | |
config.resolve.modules.add(SRC); | |
config.resolve.alias.set('jquery-ui', 'jquery-ui/ui'); | |
config.resolve.alias.set('jquery', 'jquery'); | |
config.entry('vendor').add('lodash') | |
} | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment