Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 04cfa42

Browse files
author
vvo
committed
fix(npm): try to do the right build again
cannot use style-loader along with https://github.com/istarkov/babel- plugin-webpack-loaders/ So using sass-loader and raw-loader. Cannot either use raw + css + sass loaders. issues opened at various repos, will see.
1 parent e097c13 commit 04cfa42

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

autocompleteDataset.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import createAutocompleteDataset from './src/createAutocompleteDataset.js';
2-
import './src/places.scss';
2+
import css from './src/places.scss';
3+
import insertCss from 'insert-css';
4+
insertCss(css, {prepend: true});
35

46
// must use module.exports to be commonJS compatible
57
module.exports = createAutocompleteDataset;

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"babel-register": "^6.9.0",
3535
"clipboard": "^1.5.12",
3636
"conventional-changelog-cli": "^1.2.0",
37-
"css-loader": "^0.23.1",
3837
"docsearch.js": "^1.3.0",
3938
"doctoc": "^1.2.0",
4039
"eslint": "^1.6.0",
@@ -50,13 +49,13 @@
5049
"raw-loader": "^0.5.1",
5150
"sass-loader": "^3.2.1",
5251
"semver": "^5.1.0",
53-
"style-loader": "^0.13.1",
5452
"uglify-js": "^2.6.3",
5553
"webpack": "^1.13.1"
5654
},
5755
"dependencies": {
5856
"algoliasearch": "^3.15.1",
5957
"autocomplete.js": "^0.20.1",
60-
"events": "^1.1.0"
58+
"events": "^1.1.0",
59+
"insert-css": "^0.2.0"
6160
}
6261
}

src/places.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ import './navigatorLanguage.js';
77

88
import createAutocompleteDataset from './createAutocompleteDataset.js';
99

10-
import './places.scss';
1110
import clearIcon from './icons/clear.svg';
1211
import pinIcon from './icons/address.svg';
1312

13+
import css from './places.scss';
14+
import insertCss from 'insert-css';
15+
insertCss(css, {prepend: true});
16+
1417
const errors = {
1518
multiContainers:
1619
`Algolia Places: 'container' must point to a single <input> element.

webpack.config.babel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default {
2121
test: /\.svg$/, loader: 'raw', exclude: /node_modules/
2222
}, {
2323
test: /\.scss$/, exclude: /node_modules/,
24-
loaders: ['style?insertAt=top', 'css', 'sass']
24+
loaders: ['raw', 'sass']
2525
}]
2626
},
2727
// when module not found, find locally first

0 commit comments

Comments
 (0)