Skip to content

Commit 6f2fa3c

Browse files
committed
Add support for scss, babel and root import
1 parent a61a334 commit 6f2fa3c

File tree

4 files changed

+39
-3
lines changed

4 files changed

+39
-3
lines changed

.babelrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"presets": [
3+
[
4+
"es2015",
5+
{
6+
"modules": false
7+
}
8+
],
9+
"stage-2"
10+
],
11+
"plugins": [
12+
"external-helpers"
13+
]
14+
}

package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,19 @@
1010
},
1111
"license": "MIT",
1212
"devDependencies": {
13+
"babel-core": "^6.26.0",
14+
"babel-plugin-external-helpers": "^6.22.0",
15+
"babel-preset-es2015": "^6.24.1",
16+
"babel-preset-stage-2": "^6.24.1",
17+
"babel-traverse": "6.26.0",
18+
"babel-types": "6.26.0",
19+
"babylon": "6.18.0",
20+
"lazy": "1.0.11",
1321
"rollup": "^0.50.0",
22+
"rollup-plugin-babel": "^3.0.2",
1423
"rollup-plugin-cleanup": "^1.0.1",
15-
"rollup-plugin-css-only": "^0.2.0",
24+
"rollup-plugin-root-import": "^0.2.2",
25+
"rollup-plugin-scss": "^0.3.0",
1626
"rollup-plugin-vue": "^2.4.2"
1727
},
1828
"dependencies": {

postinstall.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const fs = require('fs');
22
const path = require('path');
33

44
move(getMovePaths('rollup.config.js'), log);
5+
move(getMovePaths('.babelrc'), log);
56
move(getMovePaths('tns'), log);
67

78
fs.unlinkSync('postinstall.js');

rollup.config.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import vue from 'rollup-plugin-vue'
22
import cleanup from 'rollup-plugin-cleanup'
33
import scss from 'rollup-plugin-scss'
4+
import rootImport from 'rollup-plugin-root-import';
5+
import babel from 'rollup-plugin-babel';
46

57
export default {
68
input: './app/main.js',
@@ -12,13 +14,22 @@ export default {
1214
sourceMap: false,
1315

1416
plugins: [
17+
rootImport({
18+
// Will first look in `client/src/*` and then `common/src/*`.
19+
root: `${__dirname}/app`,
20+
useEntry: 'prepend',
21+
22+
// If we don't find the file verbatim, try adding these extensions
23+
extensions: ['.js', '.vue', '.css', '.scss']
24+
}),
1525
vue({
1626
autoStyles: false,
1727
styleToImports: true,
1828
compileTemplate: false
1929
}),
20-
scss({
21-
output: './tns/app/app.css'
30+
scss({ output: './tns/app/app.css' }),
31+
babel({
32+
exclude: 'node_modules/**'
2233
}),
2334
cleanup({
2435
extensions: ['.js', '.css']

0 commit comments

Comments
 (0)